diff --git a/hosts/ami/default.nix b/hosts/ami/default.nix index 487d0e4..58f9ed7 100644 --- a/hosts/ami/default.nix +++ b/hosts/ami/default.nix @@ -41,10 +41,16 @@ systemd = { services.register-thing = { - serviceConfig = { + serviceConfig = let + script = pkgs.writeShellApplication { + name = "run-thing"; + runtimeInputs = with pkgs; [nix]; + text = "/home/maintainer/register-thing/thing"; + }; + in { Type = "oneshot"; User = "maintainer"; - ExecStart = "/home/maintainer/register-thing/thing"; + ExecStart = "${script}/bin/run-thing"; }; };