3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #185129 from Munksgaard/fix-nixos-container

nixos-containers: Make sure same version of nixos-container is used
This commit is contained in:
adisbladis 2022-11-17 22:13:44 +13:00 committed by GitHub
commit 841bcc7a24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = [