summary refs log tree commit diff
path: root/nixos/modules/profiles/installation-device.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-10 12:04:26 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-10 15:28:55 +0200
commite5db79a8597873472c49d18061f6fd9e6f3e7437 (patch)
treeabb49f56f734be801b972e1261ffc935ba280a86 /nixos/modules/profiles/installation-device.nix
parent0f35f9bb69daea0ba2a69a806d8f472cf9ab3b92 (diff)
downloadnixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar.gz
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar.bz2
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar.lz
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar.xz
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.tar.zst
nixlib-e5db79a8597873472c49d18061f6fd9e6f3e7437.zip
Move stuff to modules/profiles/installation-device.nix
Diffstat (limited to 'nixos/modules/profiles/installation-device.nix')
-rw-r--r--nixos/modules/profiles/installation-device.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix
index a41d17e51821..946032781f40 100644
--- a/nixos/modules/profiles/installation-device.nix
+++ b/nixos/modules/profiles/installation-device.nix
@@ -1,5 +1,5 @@
 # Provide a basic configuration for installation devices like CDs.
-{ config, lib, ... }:
+{ config, pkgs, lib, ... }:
 
 with lib;
 
@@ -13,10 +13,17 @@ with lib;
       # Allow "nixos-rebuild" to work properly by providing
       # /etc/nixos/configuration.nix.
       ./clone-config.nix
+
+      # Include a copy of Nixpkgs so that nixos-install works out of
+      # the box.
+      ../installer/cd-dvd/channel.nix
     ];
 
   config = {
 
+    # Enable in installer, even if the minimal profile disables it.
+    services.nixosManual.enable = mkForce true;
+
     # Show the manual.
     services.nixosManual.showManual = true;
 
@@ -43,7 +50,7 @@ with lib;
     systemd.services.sshd.wantedBy = mkOverride 50 [];
 
     # Enable wpa_supplicant, but don't start it by default.
-    networking.wireless.enable = true;
+    networking.wireless.enable = mkDefault true;
     jobs.wpa_supplicant.startOn = mkOverride 50 "";
 
     # Tell the Nix evaluator to garbage collect more aggressively.
@@ -51,5 +58,17 @@ with lib;
     # (yet) have swap set up.
     environment.variables.GC_INITIAL_HEAP_SIZE = "100000";
 
+    # 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.  Archive::Cpio is needed for
+    # the initrd builder.
+    system.extraDependencies = [ pkgs.stdenv pkgs.busybox pkgs.perlPackages.ArchiveCpio ];
+
   };
 }