From d438b972b1210b93e1ae9314efa2028f2c3a769d Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Mon, 6 Oct 2008 23:23:28 +0000 Subject: [PATCH] nixos-rebuild: take NIXPKGS location from env, too svn path=/nixos/trunk/; revision=12981 --- default.nix | 10 ++++++---- installer/nixos-rebuild.sh | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 57b326437ec4..3923cb9592b7 100644 --- a/default.nix +++ b/default.nix @@ -1,10 +1,12 @@ let - configFileName = - let env = builtins.getEnv "NIXOS_CONFIG"; in - if env == "" then /etc/nixos/configuration.nix else env; + fromEnv = name : default : + let env = builtins.getEnv name; in + if env == "" then default else env; + configuration = import (fromEnv "NIXOS_CONFIG" /etc/nixos/configuration.nix); + nixpkgsPath = fromEnv "NIXPKGS" /etc/nixos/nixpkgs; - system = import system/system.nix {configuration = import configFileName;}; + system = import system/system.nix { inherit configuration nixpkgsPath; }; in diff --git a/installer/nixos-rebuild.sh b/installer/nixos-rebuild.sh index b8deee2f18ee..06a7a4d39fc0 100644 --- a/installer/nixos-rebuild.sh +++ b/installer/nixos-rebuild.sh @@ -5,6 +5,7 @@ NIXOS=${NIXOS:-@defaultNIXOS@} NIXPKGS=${NIXPKGS:-@defaultNIXPKGS@} NIXOS_CONFIG=${NIXOS_CONFIG:-/etc/nixos/configuration.nix} +export NIXPKGS # must be exported so that a non default location is passed to nixos/default.nix showSyntax() { # !!! more or less cut&paste from