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 = {
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";
};
};
};
};

View File

@ -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
];
}