From 3b5e493ce9be6912b0249a27c8ee920950e5e2f5 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 1 Dec 2019 01:16:49 +0100 Subject: [PATCH] lxc: set NIX_PATH --- lib/lxc/default.nix | 4 ++++ 1 file changed, 4 insertions(+) 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}