From 29d84af677a4909777aaac85b5799534590f95f1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 2 Mar 2012 12:38:22 +0000 Subject: [PATCH] * Remove the use of the NIXPKGS and NIXOS environment variables. Instead use $NIX_PATH. NIXOS_CONFIG is still supported. svn path=/nixos/trunk/; revision=32739 --- default.nix | 2 +- doc/manual/man-nixos-build-vms.xml | 23 ---------------- doc/manual/man-nixos-deploy-network.xml | 23 ---------------- doc/manual/man-nixos-option.xml | 16 ------------ doc/manual/man-nixos-rebuild.xml | 16 ------------ lib/build-vms.nix | 6 ++--- lib/eval-config.nix | 9 +++---- lib/testing.nix | 6 ++--- maintainers/option-usages.nix | 2 +- .../tools/nixos-build-vms/build-vms.nix | 5 ++-- .../tools/nixos-build-vms/nixos-build-vms.sh | 4 +-- modules/installer/tools/nixos-install.sh | 23 ++++------------ modules/installer/tools/nixos-option.sh | 15 ++--------- modules/installer/tools/nixos-rebuild.sh | 26 +++++++------------ modules/programs/bash/profile.sh | 1 - tests/default.nix | 6 ++--- 16 files changed, 34 insertions(+), 149 deletions(-) diff --git a/default.nix b/default.nix index 6c0934724c7..fda19c3a149 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,4 @@ -{ configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" /etc/nixos/configuration.nix +{ configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" , system ? builtins.currentSystem }: diff --git a/doc/manual/man-nixos-build-vms.xml b/doc/manual/man-nixos-build-vms.xml index 328d8d4f2ed..f37677629d0 100644 --- a/doc/manual/man-nixos-build-vms.xml +++ b/doc/manual/man-nixos-build-vms.xml @@ -107,27 +107,4 @@ for the same architecture as the host system. -Environment variables - - - - - NIXOS - - Path to the NixOS source tree. Defaults to - /etc/nixos/nixos. - - - - - NIXPKGS_ALL - - Path to the Nixpkgs source tree. Defaults to - /etc/nixos/nixpkgs. - - - - - - diff --git a/doc/manual/man-nixos-deploy-network.xml b/doc/manual/man-nixos-deploy-network.xml index 2a1f78f6ff8..9667fef180e 100644 --- a/doc/manual/man-nixos-deploy-network.xml +++ b/doc/manual/man-nixos-deploy-network.xml @@ -109,27 +109,4 @@ for the same architecture as the host system. -Environment variables - - - - - NIXOS - - Path to the NixOS source tree. Defaults to - /etc/nixos/nixos. - - - - - NIXPKGS_ALL - - Path to the Nixpkgs source tree. Defaults to - /etc/nixos/nixpkgs. - - - - - - diff --git a/doc/manual/man-nixos-option.xml b/doc/manual/man-nixos-option.xml index b88daa51db6..f7a8ce403dc 100644 --- a/doc/manual/man-nixos-option.xml +++ b/doc/manual/man-nixos-option.xml @@ -111,22 +111,6 @@ by nixos-hardware-scan. - - NIXOS - - Path to the NixOS source tree. Defaults to - /etc/nixos/nixos. - - - - - NIXPKGS - - Path to the Nixpkgs source tree. Defaults to - /etc/nixos/nixpkgs. - - - NIXOS_CONFIG diff --git a/doc/manual/man-nixos-rebuild.xml b/doc/manual/man-nixos-rebuild.xml index 2e07246cf8d..0b55540126c 100644 --- a/doc/manual/man-nixos-rebuild.xml +++ b/doc/manual/man-nixos-rebuild.xml @@ -271,22 +271,6 @@ the Nix manual for details. - - NIXOS - - Path to the NixOS source tree. Defaults to - /etc/nixos/nixos. - - - - - NIXPKGS - - Path to the Nixpkgs source tree. Defaults to - /etc/nixos/nixpkgs. - - - NIXOS_CONFIG diff --git a/lib/build-vms.nix b/lib/build-vms.nix index 87ca2a711d1..e8e5885137d 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -1,6 +1,6 @@ -{ nixpkgs, system }: +{ system }: -let pkgs = import nixpkgs { config = {}; inherit system; }; in +let pkgs = import { config = {}; inherit system; }; in with pkgs; with import ../lib/qemu-flags.nix; @@ -22,7 +22,7 @@ rec { nodes: configurations: import ./eval-config.nix { - inherit nixpkgs system; + inherit system; modules = configurations ++ [ ../modules/virtualisation/qemu-vm.nix ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs diff --git a/lib/eval-config.nix b/lib/eval-config.nix index c646d52c802..ffc0db1c7ea 100644 --- a/lib/eval-config.nix +++ b/lib/eval-config.nix @@ -3,7 +3,6 @@ # values. { system ? builtins.currentSystem -, nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs , pkgs ? null , baseModules ? import ../modules/module-list.nix , extraArgs ? {} @@ -31,7 +30,7 @@ rec { extraArgs = extraArgs_ // { inherit pkgs modules baseModules; modulesPath = ../modules; - pkgs_i686 = import nixpkgs { system = "i686-linux"; }; + pkgs_i686 = import { system = "i686-linux"; }; }; # Import Nixpkgs, allowing the NixOS option nixpkgs.config to @@ -47,15 +46,15 @@ rec { pkgs = if pkgs_ != null then pkgs_ - else import nixpkgs ( + else import ( let system = if nixpkgsOptions.system != "" then nixpkgsOptions.system else system_; nixpkgsOptions = (import ./eval-config.nix { - inherit system nixpkgs extraArgs modules; + inherit system extraArgs modules; # For efficiency, leave out most NixOS modules; they don't # define nixpkgs.config, so it's pointless to evaluate them. baseModules = [ ../modules/misc/nixpkgs.nix ]; - pkgs = import nixpkgs { system = system_; config = {}; }; + pkgs = import { system = system_; config = {}; }; }).optionDefinitions.nixpkgs; in { diff --git a/lib/testing.nix b/lib/testing.nix index 9b49bad580f..c8e3d7bbc97 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -1,6 +1,6 @@ -{ nixpkgs, system }: +{ system }: -with import ./build-vms.nix { inherit nixpkgs system; }; +with import ./build-vms.nix { inherit system; }; with pkgs; rec { @@ -118,7 +118,7 @@ rec { makeTests = testsFun: lib.mapAttrs (name: complete) (call testsFun); apply = makeTest; # compatibility - call = f: f { inherit pkgs nixpkgs system; }; + call = f: f { inherit pkgs system; }; complete = t: t // rec { nodes = buildVirtualNetwork ( diff --git a/maintainers/option-usages.nix b/maintainers/option-usages.nix index e0532e9e548..7413b9e18ce 100644 --- a/maintainers/option-usages.nix +++ b/maintainers/option-usages.nix @@ -1,4 +1,4 @@ -{ configuration ? import ../lib/from-env.nix "NIXOS_CONFIG" /etc/nixos/configuration.nix +{ configuration ? import ../lib/from-env.nix "NIXOS_CONFIG" # []: display all options # [