test: deploying

This commit is contained in:
silver 2023-08-05 22:57:55 +01:00
parent ae7b73176c
commit 5a6928fbd3

View file

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