created startup_validation services and timer

This commit is contained in:
Richie Cahill 2024-07-07 10:53:17 -04:00 committed by Alice Huston
parent d6d39dd89c
commit c07d09b1b3
2 changed files with 33 additions and 13 deletions

View File

@ -1,19 +1,38 @@
{ pkgs, ... }: { inputs, pkgs, ... }:
{ {
systemd = { systemd = {
services."plex_permission" = { services = {
description = "maintains /zfs/storage/plex permissions"; plex_permission = {
serviceConfig = { description = "maintains /zfs/storage/plex permissions";
Type = "oneshot"; serviceConfig = {
ExecStart = "${pkgs.bash}/bin/bash ${./scripts/plex_permission.sh}"; Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash ${./scripts/plex_permission.sh}";
};
}; };
}; };
timers."plex_permission" = { startup_validation = {
wantedBy = [ "timers.target" ]; wantedBy = [ "multi-user.target" ];
timerConfig = { description = "validates startup";
OnBootSec = "1h"; serviceConfig = {
OnCalendar = "daily 03:00"; Type = "oneshot";
Unit = "plex_permission.service"; 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";
};
}; };
}; };
}; };

View File

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, inputs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
# cli # cli
@ -43,5 +43,6 @@
nix-prefetch nix-prefetch
nix-tree nix-tree
nixpkgs-fmt nixpkgs-fmt
inputs.server_tools.packages.x86_64-linux.server_tools
]; ];
} }