diff --git a/lib/lxc/default.nix b/lib/lxc/default.nix index a3be7663..6d704251 100644 --- a/lib/lxc/default.nix +++ b/lib/lxc/default.nix @@ -5,6 +5,7 @@ let profilesDir = "/nix/var/nix/profiles/lxc"; gcRoots = "/nix/var/nix/gcroots/lxc"; containers = config.lxc.containers; + nixPath = config.nix.nixPath; in { options = with types; { lxc.containers = mkOption { @@ -31,6 +32,9 @@ in { serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; + serviceConfig.Environment = [ + ''NIX_PATH=${builtins.concatStringsSep ":" nixPath}'' + ]; script = '' mkdir -p ${profilesDir}/${name}