diff options
author | adisbladis <adisbladis@gmail.com> | 2022-11-17 22:13:44 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 22:13:44 +1300 |
commit | 841bcc7a249235d5a353ba2f6a8be0aae6333b03 (patch) | |
tree | cf30077dd6d23e027cbb68872d185cfa47d6d7cb /nixos/modules/virtualisation | |
parent | 54be84c3ac0122c2b2272fc68a9015304bc0bb73 (diff) | |
parent | 3daea5fa9be672031f97fe3b2c360257821165e5 (diff) |
Merge pull request #185129 from Munksgaard/fix-nixos-container
nixos-containers: Make sure same version of nixos-container is used
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/nixos-containers.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix index 02414b7d60e99..e1e640c447425 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -9,6 +9,10 @@ let configurationDirectory = "/etc/${configurationDirectoryName}"; stateDirectory = "/var/lib/${configurationPrefix}containers"; + nixos-container = pkgs.nixos-container.override { + inherit stateDirectory configurationDirectory; + }; + # The container's init script, a small wrapper around the regular # NixOS stage-2 init script. containerInit = (cfg: @@ -250,7 +254,7 @@ let ExecReload = pkgs.writeScript "reload-container" '' #! ${pkgs.runtimeShell} -e - ${pkgs.nixos-container}/bin/nixos-container run "$INSTANCE" -- \ + ${nixos-container}/bin/nixos-container run "$INSTANCE" -- \ bash --login -c "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test" ''; @@ -868,9 +872,7 @@ in ''; environment.systemPackages = [ - (pkgs.nixos-container.override { - inherit stateDirectory configurationDirectory; - }) + nixos-container ]; boot.kernelModules = [ |