nix-dotfiles/systems/jeeves/services.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

2024-07-07 19:47:11 -04:00
{
config,
inputs,
pkgs,
...
}:
2024-06-22 12:40:50 -04:00
{
systemd = {
services = {
plex_permission = {
description = "maintains /zfs/storage/plex permissions";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash ${./scripts/plex_permission.sh}";
};
};
2024-07-07 12:38:55 -04:00
startup_validation = {
wantedBy = [ "multi-user.target" ];
description = "validates startup";
serviceConfig = {
2024-07-07 19:47:11 -04:00
Environment = config.sops.secrets."server-validation/webhook".path;
2024-07-07 12:38:55 -04:00
Type = "oneshot";
ExecStart = "${inputs.server_tools.packages.x86_64-linux.default}/bin/validate_jeeves";
};
2024-06-22 12:40:50 -04:00
};
};
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";
};
2024-06-22 12:40:50 -04:00
};
};
};
2024-07-07 19:47:11 -04:00
sops = {
defaultSopsFile = ./secrets.yaml;
secrets."server-validation/webhook".owner = "root";
};
2024-06-22 12:40:50 -04:00
}