diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2022-10-27 17:52:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 17:52:45 +0200 |
commit | 8837a5d68efc8dedfb7f7e0a636ea6f81ae06c71 (patch) | |
tree | 2d81e21921b049cf9309300c86b2caea9f812cc3 /nixos/modules/virtualisation | |
parent | d7dae316b4a191f9434452fd010025fe0bfb26e2 (diff) | |
parent | f4ccaa51e00d1fa9dde060a90e4b721ddbe5024a (diff) |
Merge pull request #195681 from maifel-maifel/mr-containers-hostPlatform
nixos/containers: now uses nixpkgs.hostPlatform
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 6cb21913b2197..fae7c57680521 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }@host: with lib; @@ -284,7 +284,6 @@ let DeviceAllow = map (d: "${d.node} ${d.modifier}") cfg.allowedDevices; }; - inherit (config.nixpkgs) localSystem; kernelVersion = config.boot.kernelPackages.kernel.version; bindMountOpts = { name, ... }: { @@ -480,10 +479,13 @@ in merge = loc: defs: (import "${toString config.nixpkgs}/nixos/lib/eval-config.nix" { modules = let - extraConfig = { + extraConfig = { options, ... }: { _file = "module at ${__curPos.file}:${toString __curPos.line}"; config = { - nixpkgs = { inherit localSystem; }; + nixpkgs = if options.nixpkgs?hostPlatform && host.options.nixpkgs.hostPlatform.isDefined + then { inherit (host.config.nixpkgs) hostPlatform; } + else { inherit (host.config.nixpkgs) localSystem; } + ; boot.isContainer = true; networking.hostName = mkDefault name; networking.useDHCP = false; |