diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix index 1f96fa2de491..ba5112aa6cec 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -488,9 +488,10 @@ in extraConfig = { options, ... }: { _file = "module at ${__curPos.file}:${toString __curPos.line}"; config = { - nixpkgs = if options.nixpkgs?hostPlatform && host.options.nixpkgs.hostPlatform.isDefined - then { inherit (host.config.nixpkgs) hostPlatform; } - else { inherit (host.config.nixpkgs) localSystem; } + nixpkgs = + if options.nixpkgs?hostPlatform + then { inherit (host.pkgs.stdenv) hostPlatform; } + else { localSystem = host.pkgs.stdenv.hostPlatform; } ; boot.isContainer = true; networking.hostName = mkDefault name;