repo-clone/service.nix

27 lines
532 B
Nix

{ 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 ''
echo "hello!"
echo "${config.repo-clone.pkg}"
'';
in
"${script}/bin/${execName}";
RemainAfterExit = "yes";
};
Install.WantedBy = [ "multi-user.target" ];
}