nix-dotfiles/systems/jeeves/services.nix

53 lines
1.3 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 = {
2024-07-26 20:22:27 -04:00
requires = [ "network-online.target" ];
after = [ "network-online.target" ];
2024-07-07 12:38:55 -04:00
wantedBy = [ "multi-user.target" ];
description = "validates startup";
2024-07-08 18:22:58 -04:00
path = [ pkgs.zfs ];
2024-07-07 12:38:55 -04:00
serviceConfig = {
EnvironmentFile = config.sops.secrets."server-validation/webhook".path;
2024-07-07 12:38:55 -04:00
Type = "oneshot";
2024-08-11 10:30:37 -04:00
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_jeeves";
2024-07-07 12:38:55 -04:00
};
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
}