From f299ec50f61255c54fbe8bd80ed3c2b983cd1109 Mon Sep 17 00:00:00 2001 From: buffet Date: Mon, 17 Jun 2024 13:25:29 +0200 Subject: [PATCH] fix: add nix as a runtime input to registration script --- hosts/ami/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hosts/ami/default.nix b/hosts/ami/default.nix index 4b6784a..4c4e5ab 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"; }; };