nixos/nixpkgs: make config.nixpkgs.{localSystem,crossSystem,buildPlatform,hostPlatform} write only
The description for options.nixpkgs.system already hints at this:
Neither ${opt.system} nor any other option in nixpkgs.* is meant
to be read by modules and configurations.
Use pkgs.stdenv.hostPlatform instead.
We can support this goal by not elaborating the systems anymore, forcing
users to go via pkgs.stdenv.
This will prevent problems when making the top-level package sets
composable in the next commit. For this to work, you should pass a fully
elaborated system to nixpkgs' localSystem or crossSystem options.
This commit is contained in:
@@ -506,8 +506,12 @@ in
|
||||
config = {
|
||||
nixpkgs =
|
||||
if options.nixpkgs?hostPlatform
|
||||
then { inherit (host.pkgs.stdenv) hostPlatform; }
|
||||
else { localSystem = host.pkgs.stdenv.hostPlatform; }
|
||||
then {
|
||||
hostPlatform =
|
||||
if host.options.nixpkgs.hostPlatform.isDefined
|
||||
then host.config.nixpkgs.hostPlatform
|
||||
else lib.defaultTo host.config.nixpkgs.localSystem host.config.nixpkgs.crossSystem;
|
||||
} else { localSystem = lib.defaultTo host.config.nixpkgs.localSystem host.config.nixpkgs.crossSystem; }
|
||||
;
|
||||
boot.isContainer = true;
|
||||
networking.hostName = mkDefault name;
|
||||
|
||||
Reference in New Issue
Block a user