Revert "nixpkgs module: Fix defaulting of localSystem
and system
"
This reverts commit 4fe2898608
.
This gives a recursion in certain nixpkgs configs.
This commit is contained in:
parent
0fbc3451ef
commit
05eb57b35d
@ -1,10 +1,9 @@
|
||||
{ config, options, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.nixpkgs;
|
||||
opts = options.nixpgs;
|
||||
|
||||
isConfig = x:
|
||||
builtins.isAttrs x || lib.isFunction x;
|
||||
@ -63,11 +62,12 @@ in
|
||||
pkgs = mkOption {
|
||||
defaultText = literalExample
|
||||
''import "''${nixos}/.." {
|
||||
inherit (cfg) config overlays localSystem crossSystem;
|
||||
inherit (config.nixpkgs) config overlays localSystem crossSystem;
|
||||
}
|
||||
'';
|
||||
default = import ../../.. {
|
||||
inherit (cfg) config overlays localSystem crossSystem;
|
||||
localSystem = { inherit (cfg) system; } // cfg.localSystem;
|
||||
inherit (cfg) config overlays crossSystem;
|
||||
};
|
||||
type = pkgsType;
|
||||
example = literalExample ''import <nixpkgs> {}'';
|
||||
@ -140,7 +140,7 @@ in
|
||||
|
||||
localSystem = mkOption {
|
||||
type = types.attrs; # TODO utilize lib.systems.parsedPlatform
|
||||
default = { system = cfg.system or builtins.currentSystem; };
|
||||
default = { system = builtins.currentSystem; };
|
||||
example = { system = "aarch64-linux"; config = "aarch64-unknown-linux-gnu"; };
|
||||
defaultText = literalExample
|
||||
''(import "''${nixos}/../lib").lib.systems.examples.aarch64-multiplatform'';
|
||||
@ -179,8 +179,6 @@ in
|
||||
|
||||
system = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.localSystem.system
|
||||
or opts.localSystem.default.system;
|
||||
example = "i686-linux";
|
||||
description = ''
|
||||
Specifies the Nix platform type on which NixOS should be built.
|
||||
@ -198,7 +196,6 @@ in
|
||||
</programlisting>
|
||||
See <code>nixpkgs.localSystem</code> for more information.
|
||||
|
||||
Ignored when <code>nixpkgs.localSystem</code> is set.
|
||||
Ignored when <code>nixpkgs.pkgs</code> is set.
|
||||
'';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user