From d99fce26312706fa80ee67427bc252b774a6394f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 2 Mar 2013 20:02:32 +0100 Subject: [PATCH] installation-cd-base.nix: Use boot.kernel.sysctl --- .../installer/cd-dvd/installation-cd-base.nix | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/installer/cd-dvd/installation-cd-base.nix b/modules/installer/cd-dvd/installation-cd-base.nix index 1edb2a45236..d9ffbda3660 100644 --- a/modules/installer/cd-dvd/installation-cd-base.nix +++ b/modules/installer/cd-dvd/installation-cd-base.nix @@ -42,26 +42,24 @@ in isoImage.volumeID = "NIXOS_${config.system.nixosVersion}"; - boot.postBootCommands = + # Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required + # for nixos-install. + boot.postBootCommands = optionalString includeSources '' - # Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required - # for nixos-install. - ${optionalString includeSources '' - 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 - ''} - - # Make the installer more likely to succeed in low memory - # environments. The kernel's overcommit heustistics bite us - # fairly often, preventing processes such as nix-worker or - # download-using-manifests.pl from forking even if there is - # plenty of free memory. - echo 1 > /proc/sys/vm/overcommit_memory + 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 ''; + # Make the installer more likely to succeed in low memory + # environments. The kernel's overcommit heustistics bite us + # fairly often, preventing processes such as nix-worker or + # download-using-manifests.pl from forking even if there is + # plenty of free memory. + boot.kernel.sysctl."vm.overcommit_memory" = "1"; + # To speed up installation a little bit, include the complete stdenv # in the Nix store on the CD. isoImage.storeContents = [ pkgs.stdenv pkgs.busybox ];