summary refs log tree commit diff
path: root/nixos/modules/misc/nixpkgs.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-05-31 15:55:06 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2018-05-31 15:55:36 -0400
commit05eb57b35d2859dd3981ab20c7e2a2ccfc530b75 (patch)
treed3810adc037706c33110fcef5845500ba3e76cfb /nixos/modules/misc/nixpkgs.nix
parent0fbc3451ef82f73ecc1a6ae10c68a72bbf13abf9 (diff)
downloadnixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar.gz
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar.bz2
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar.lz
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar.xz
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.tar.zst
nixpkgs-05eb57b35d2859dd3981ab20c7e2a2ccfc530b75.zip
Revert "nixpkgs module: Fix defaulting of `localSystem` and `system`"
This reverts commit 4fe289860888668956b7e79e24efeb101c2f51d1.

This gives a recursion in certain nixpkgs configs.
Diffstat (limited to 'nixos/modules/misc/nixpkgs.nix')
-rw-r--r--nixos/modules/misc/nixpkgs.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix
index 29019ed3d55..8fbe218b232 100644
--- a/nixos/modules/misc/nixpkgs.nix
+++ b/nixos/modules/misc/nixpkgs.nix
@@ -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.
       '';
     };