lxc: set NIX_PATH

This commit is contained in:
Astro 2019-12-01 01:16:49 +01:00
parent d94e9775c6
commit 3b5e493ce9
1 changed files with 4 additions and 0 deletions

View File

@ -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}