From c07d09b1b366c785de5e215fef4a182c83135acc Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Sun, 7 Jul 2024 10:53:17 -0400 Subject: [PATCH] created startup_validation services and timer --- systems/jeeves/services.nix | 43 ++++++++++++++++++++++++---------- users/richie/home/programs.nix | 3 ++- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/systems/jeeves/services.nix b/systems/jeeves/services.nix index 3045501..c83ba89 100644 --- a/systems/jeeves/services.nix +++ b/systems/jeeves/services.nix @@ -1,19 +1,38 @@ -{ pkgs, ... }: +{ inputs, pkgs, ... }: { systemd = { - services."plex_permission" = { - description = "maintains /zfs/storage/plex permissions"; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.bash}/bin/bash ${./scripts/plex_permission.sh}"; + services = { + plex_permission = { + description = "maintains /zfs/storage/plex permissions"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash ${./scripts/plex_permission.sh}"; + }; }; }; - timers."plex_permission" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "1h"; - OnCalendar = "daily 03:00"; - Unit = "plex_permission.service"; + startup_validation = { + wantedBy = [ "multi-user.target" ]; + description = "validates startup"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${inputs.server_tools.packages.x86_64-linux.server_tools}/bin/validate_jeeves"; + }; + }; + timers = { + plex_permission = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "1h"; + OnCalendar = "daily 03:00"; + Unit = "plex_permission.service"; + }; + }; + startup_validation = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "10min"; + Unit = "startup_validation.service"; + }; }; }; }; diff --git a/users/richie/home/programs.nix b/users/richie/home/programs.nix index cb60359..aaf166a 100644 --- a/users/richie/home/programs.nix +++ b/users/richie/home/programs.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, inputs, ... }: { home.packages = with pkgs; [ # cli @@ -43,5 +43,6 @@ nix-prefetch nix-tree nixpkgs-fmt + inputs.server_tools.packages.x86_64-linux.server_tools ]; }