Separate fix-point from config importing hacks and other impurities

Changed files
+28 -17
pkgs
+1 -1
default.nix
···
else
-
import ./pkgs/top-level
+
import ./pkgs/top-level/impure.nix
+3 -16
pkgs/top-level/default.nix
···
{ # The system (e.g., `i686-linux') for which to build the packages.
-
system ? builtins.currentSystem
+
system
, # The standard environment to use. Only used for bootstrapping. If
# null, the default standard environment is used.
···
&& system != "x86_64-solaris"
&& system != "x86_64-kfreebsd-gnu")
-
, # Allow a configuration attribute set to be passed in as an
-
# argument. Otherwise, it's read from $NIXPKGS_CONFIG or
-
# ~/.nixpkgs/config.nix.
-
#
-
# [For NixOS (nixos-rebuild), use nixpkgs.config option to set.]
-
config ? let
-
inherit (builtins) getEnv pathExists;
-
-
configFile = getEnv "NIXPKGS_CONFIG";
-
homeDir = getEnv "HOME";
-
configFile2 = homeDir + "/.nixpkgs/config.nix";
-
in
-
if configFile != "" && pathExists configFile then import configFile
-
else if homeDir != "" && pathExists configFile2 then import configFile2
-
else {}
+
, # Allow a configuration attribute set to be passed in as an argument.
+
config ? {}
, crossSystem ? null
, platform ? null
+24
pkgs/top-level/impure.nix
···
+
/* Impure default args for `pkgs/top-level/default.nix`. See that file
+
for the meaning of each argument. */
+
+
{ # Fallback: Assume we are building packages for the current (host, in GNU
+
# Autotools parlance) system.
+
system ? builtins.currentSystem
+
+
, # Fallback: The contents of the configuration file found at $NIXPKGS_CONFIG or
+
# $HOME/.nixpkgs/config.nix.
+
config ? let
+
inherit (builtins) getEnv pathExists;
+
+
configFile = getEnv "NIXPKGS_CONFIG";
+
homeDir = getEnv "HOME";
+
configFile2 = homeDir + "/.nixpkgs/config.nix";
+
in
+
if configFile != "" && pathExists configFile then import configFile
+
else if homeDir != "" && pathExists configFile2 then import configFile2
+
else {}
+
+
, ...
+
} @ args:
+
+
import ./. (args // { inherit system config; })