From d156ab6c9c98a5ac94d52989cb178bb2e26658af Mon Sep 17 00:00:00 2001 From: Joseph Stahl <1269177+josephst@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:38:37 -0500 Subject: [PATCH] nixos/lxc-container: use absolute path for ln in install-lxc-sbin-init.sh Recent change to nixos-rebuild (https://github.com/NixOS/nixpkgs/pull/258571) adds systemd-run, which brings with it a cleaner environment (ie $PATH not available). Workaround: use absolute path for ln to avoid command-not-found error --- nixos/modules/virtualisation/lxc-container.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/lxc-container.nix b/nixos/modules/virtualisation/lxc-container.nix index c40c7bee1886..1034c699629d 100644 --- a/nixos/modules/virtualisation/lxc-container.nix +++ b/nixos/modules/virtualisation/lxc-container.nix @@ -66,7 +66,7 @@ in { system.build.installBootLoader = pkgs.writeScript "install-lxd-sbin-init.sh" '' #!${pkgs.runtimeShell} - ln -fs "$1/init" /sbin/init + ${pkgs.coreutils}/bin/ln -fs "$1/init" /sbin/init ''; systemd.additionalUpstreamSystemUnits = lib.mkIf cfg.nestedContainer ["systemd-udev-trigger.service"];