@@ -62,12 +62,11 @@ in
6262 pkgs = mkOption {
6363 defaultText = literalExample
6464 ''import "''${nixos}/.." {
65− inherit (config.nixpkgs) config overlays localSystem crossSystem;
65+ inherit (cfg) config overlays localSystem crossSystem;
6666 }
6767 '';
6868 default = import ../../.. {
69− localSystem = { inherit (cfg) system; } // cfg.localSystem;
70− inherit (cfg) config overlays crossSystem;
69+ inherit (cfg) config overlays localSystem crossSystem;
7170 };
7271 type = pkgsType;
7372 example = literalExample ''import <nixpkgs> {}'';
@@ -140,8 +139,11 @@ in
140139
141140 localSystem = mkOption {
142141 type = types.attrs; # TODO utilize lib.systems.parsedPlatform
143− default = { system = builtins.currentSystem; };
142+ default = { inherit (cfg) system; };
144143 example = { system = "aarch64-linux"; config = "aarch64-unknown-linux-gnu"; };
144+ # Make sure that the final value has all fields for sake of other modules
145+ # referring to this. TODO make `lib.systems` itself use the module system.
146+ apply = lib.systems.elaborate;
145147 defaultText = literalExample
146148 ''(import "''${nixos}/../lib").lib.systems.examples.aarch64-multiplatform'';
147149 description = ''
@@ -180,6 +182,7 @@ in
180182 system = mkOption {
181183 type = types.str;
182184 example = "i686-linux";
185+ default = { system = builtins.currentSystem; };
183186 description = ''
184187 Specifies the Nix platform type on which NixOS should be built.
185188 It is better to specify <code>nixpkgs.localSystem</code> instead.
@@ -196,6 +199,7 @@ in
196199 </programlisting>
197200 See <code>nixpkgs.localSystem</code> for more information.
198201
202+ Ignored when <code>nixpkgs.localSystem</code> is set.
199203 Ignored when <code>nixpkgs.pkgs</code> is set.
200204 '';
201205 };