2024-08-01 08:48:41 +00:00
|
|
|
{ config, service, pkgs }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs)
|
|
|
|
writeShellScriptBin;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
Unit = {
|
|
|
|
Description = "${service} service";
|
|
|
|
X-Restart-Triggers = [ "${config.repo-clone.pkg}" ];
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
Type = "exec";
|
|
|
|
ExecStart =
|
|
|
|
let
|
|
|
|
execName = service;
|
|
|
|
script = writeShellScriptBin execName ''
|
2024-08-01 09:10:43 +00:00
|
|
|
while IFS="" read -r p || [ -n "$p" ]
|
|
|
|
do
|
|
|
|
printf '%s\n' "$p"
|
|
|
|
done < "${config.repo-clone.pkg}"
|
2024-08-01 08:48:41 +00:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
"${script}/bin/${execName}";
|
|
|
|
RemainAfterExit = "yes";
|
|
|
|
};
|
|
|
|
Install.WantedBy = [ "multi-user.target" ];
|
|
|
|
}
|