From db17b68d8118e9b5d5d61ca807c36118d6b052d6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Jul 2013 00:21:56 +0200 Subject: [PATCH] Unpack the initial channel only once --- modules/installer/cd-dvd/channel.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/installer/cd-dvd/channel.nix b/modules/installer/cd-dvd/channel.nix index 4e84e45b736..bc758e0ad6e 100644 --- a/modules/installer/cd-dvd/channel.nix +++ b/modules/installer/cd-dvd/channel.nix @@ -29,10 +29,14 @@ in # for nixos-install. boot.postBootCommands = '' - echo "unpacking the NixOS/Nixpkgs sources..." - mkdir -p /nix/var/nix/profiles/per-user/root - ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels -i ${channelSources} --quiet - mkdir -m 0700 -p /root/.nix-defexpr - ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels + if ! [ -e /var/lib/nixos/did-channel-init ]; then + echo "unpacking the NixOS/Nixpkgs sources..." + mkdir -p /nix/var/nix/profiles/per-user/root + ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels -i ${channelSources} --quiet + mkdir -m 0700 -p /root/.nix-defexpr + ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels + mkdir -m 0755 -p /var/lib/nixos + touch /var/lib/nixos/did-channel-init + fi ''; }