test: deploying
This commit is contained in:
parent
ae7b73176c
commit
5a6928fbd3
1 changed files with 6 additions and 6 deletions
12
flake.nix
12
flake.nix
|
@ -71,7 +71,7 @@
|
|||
service_name = script: lib.strings.sanitizeDerivationName("${cfg.prefix}${cfg.user}@${script}");
|
||||
|
||||
# oneshot scripts to run
|
||||
serviceGenerator = builtins.mapAttrs (script: time: nameValuePair (service_name script) {
|
||||
serviceGenerator = mapAttrs' (script: time: nameValuePair (service_name script) {
|
||||
description = "Service for ${desc} ${script}";
|
||||
wantedBy = [ ];
|
||||
after = [ "network-online.target" ];
|
||||
|
@ -83,10 +83,10 @@
|
|||
ExecStart = "${self.defaultPackage."${system}"}/bin/${script}";
|
||||
EnvironmentFile = "${cfg.envFile}";
|
||||
};
|
||||
}) scripts;
|
||||
});
|
||||
|
||||
# each timer will run the above service
|
||||
timerGenerator = builtins.mapAttrs (script: time: nameValuePair (service_name script) {
|
||||
timerGenerator = mapAttrs' (script: time: nameValuePair (service_name script) {
|
||||
description = "Timer for ${desc} ${script}";
|
||||
|
||||
wantedBy = [ "timers.target" ];
|
||||
|
@ -96,7 +96,7 @@
|
|||
Unit = "${service_name script}.service";
|
||||
Persistent = true;
|
||||
};
|
||||
}) scripts;
|
||||
});
|
||||
|
||||
# modify these
|
||||
scripts = {
|
||||
|
@ -221,10 +221,10 @@
|
|||
EnvironmentFile = "${cfg.envFile}";
|
||||
};
|
||||
};
|
||||
} // serviceGenerator;
|
||||
} // serviceGenerator scripts;
|
||||
|
||||
# timers to run the above services
|
||||
systemd.timers = timerGenerator;
|
||||
systemd.timers = timerGenerator scripts;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue