From 1fef99942e47e9e9e37e6c4f16726d2ce85a3eef Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Sep 2016 16:07:24 +0200 Subject: nixos-rebuild: Move the Nix fallback store paths into a separate file --- nixos/modules/installer/tools/nix-fallback-paths.nix | 5 +++++ nixos/modules/installer/tools/nixos-rebuild.sh | 4 ++-- nixos/modules/installer/tools/tools.nix | 14 +++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 nixos/modules/installer/tools/nix-fallback-paths.nix diff --git a/nixos/modules/installer/tools/nix-fallback-paths.nix b/nixos/modules/installer/tools/nix-fallback-paths.nix new file mode 100644 index 000000000000..67a34d8a8ddf --- /dev/null +++ b/nixos/modules/installer/tools/nix-fallback-paths.nix @@ -0,0 +1,5 @@ +{ + x86_64-linux = "/nix/store/xryr9g56h8yjddp89d6dw12anyb4ch7c-nix-1.10"; + i686-linux = "/nix/store/2w92k5wlpspf0q2k9mnf2z42prx3bwmv-nix-1.10"; +} + diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 803989789838..36700d2bf566 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -261,9 +261,9 @@ fi prebuiltNix() { machine="$1" if [ "$machine" = x86_64 ]; then - echo /nix/store/xryr9g56h8yjddp89d6dw12anyb4ch7c-nix-1.10 + echo @nix_x86_64_linux@ elif [[ "$machine" =~ i.86 ]]; then - echo /nix/store/2w92k5wlpspf0q2k9mnf2z42prx3bwmv-nix-1.10 + echo @nix_i686_linux@ else echo "$0: unsupported platform" exit 1 diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index fc39a653abdc..a35f6ad8ae54 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -32,11 +32,15 @@ let "cp refs $out"; }; - nixos-rebuild = makeProg { - name = "nixos-rebuild"; - src = ./nixos-rebuild.sh; - nix = config.nix.package.out; - }; + nixos-rebuild = + let fallback = import ./nix-fallback-paths.nix; in + makeProg { + name = "nixos-rebuild"; + src = ./nixos-rebuild.sh; + nix = config.nix.package.out; + nix_x86_64_linux = fallback.x86_64-linux; + nix_i686_linux = fallback.i686-linux; + }; nixos-generate-config = makeProg { name = "nixos-generate-config"; -- cgit 1.4.1