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}"); service_name = script: lib.strings.sanitizeDerivationName("${cfg.prefix}${cfg.user}@${script}");
# oneshot scripts to run # 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}"; description = "Service for ${desc} ${script}";
wantedBy = [ ]; wantedBy = [ ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
@ -83,10 +83,10 @@
ExecStart = "${self.defaultPackage."${system}"}/bin/${script}"; ExecStart = "${self.defaultPackage."${system}"}/bin/${script}";
EnvironmentFile = "${cfg.envFile}"; EnvironmentFile = "${cfg.envFile}";
}; };
}) scripts; });
# each timer will run the above service # 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}"; description = "Timer for ${desc} ${script}";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
@ -96,7 +96,7 @@
Unit = "${service_name script}.service"; Unit = "${service_name script}.service";
Persistent = true; Persistent = true;
}; };
}) scripts; });
# modify these # modify these
scripts = { scripts = {
@ -221,10 +221,10 @@
EnvironmentFile = "${cfg.envFile}"; EnvironmentFile = "${cfg.envFile}";
}; };
}; };
} // serviceGenerator; } // serviceGenerator scripts;
# timers to run the above services # timers to run the above services
systemd.timers = timerGenerator; systemd.timers = timerGenerator scripts;
}; };