nixos-rebuild: take NIXPKGS location from env, too
svn path=/nixos/trunk/; revision=12981
This commit is contained in:
parent
5ea24925b5
commit
d438b972b1
10
default.nix
10
default.nix
|
@ -1,10 +1,12 @@
|
||||||
let
|
let
|
||||||
|
|
||||||
configFileName =
|
fromEnv = name : default :
|
||||||
let env = builtins.getEnv "NIXOS_CONFIG"; in
|
let env = builtins.getEnv name; in
|
||||||
if env == "" then /etc/nixos/configuration.nix else env;
|
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
|
in
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
NIXOS=${NIXOS:-@defaultNIXOS@}
|
NIXOS=${NIXOS:-@defaultNIXOS@}
|
||||||
NIXPKGS=${NIXPKGS:-@defaultNIXPKGS@}
|
NIXPKGS=${NIXPKGS:-@defaultNIXPKGS@}
|
||||||
NIXOS_CONFIG=${NIXOS_CONFIG:-/etc/nixos/configuration.nix}
|
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() {
|
showSyntax() {
|
||||||
# !!! more or less cut&paste from
|
# !!! more or less cut&paste from
|
||||||
|
|
Loading…
Reference in New Issue