From b9dd7509b62dbc7b5e401cc5441f2a0e81616eae Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Sep 2007 15:38:05 +0000 Subject: [PATCH] * nixos-rebuild: before building NixOS, first build the latest Nix and use that one to build NixOS. This will make it easier to use bleeding-edge features in the NixOS expressions. svn path=/nixos/trunk/; revision=9336 --- default.nix | 2 ++ installer/nixos-rebuild.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/default.nix b/default.nix index 90aa4d33ad9..889d2ca873f 100644 --- a/default.nix +++ b/default.nix @@ -26,6 +26,8 @@ in config ; + nixFallback = system.nix; + manifests = system.config.get ["installer" "manifests"]; # exported here because nixos-rebuild uses it upstartJobsCombined = system.upstartJobs; diff --git a/installer/nixos-rebuild.sh b/installer/nixos-rebuild.sh index 94ef51ee468..fbbd3e691f7 100644 --- a/installer/nixos-rebuild.sh +++ b/installer/nixos-rebuild.sh @@ -40,6 +40,13 @@ if test -z "$NIXOS_NO_PULL"; then fi +# First build Nix, since NixOS may require a newer version than the +# current one. Of course, the same goes for Nixpkgs, but Nixpkgs is +# more conservative. +nix-build $NIXOS -A nixFallback -o $HOME/nix-tmp +PATH=$HOME/nix-tmp/bin:$PATH + + # Either upgrade the configuration in the system profile (for "switch" # or "boot"), or just build it and create a symlink "result" in the # current directory (for "build" and "test"). @@ -69,3 +76,6 @@ active system configuration may be garbage collected! This may render the system inoperable (though a reboot will fix things). EOF fi + + +rm -f $HOME/nix-tmp