1# Provide a basic configuration for installation devices like CDs.
2{ config, pkgs, lib, ... }:
3
4with lib;
5
6{
7 imports =
8 [ # Enable devices which are usually scanned, because we don't know the
9 # target system.
10 ../installer/scan/detected.nix
11 ../installer/scan/not-detected.nix
12
13 # Allow "nixos-rebuild" to work properly by providing
14 # /etc/nixos/configuration.nix.
15 ./clone-config.nix
16
17 # Include a copy of Nixpkgs so that nixos-install works out of
18 # the box.
19 ../installer/cd-dvd/channel.nix
20 ];
21
22 config = {
23
24 # Enable in installer, even if the minimal profile disables it.
25 services.nixosManual.enable = mkForce true;
26
27 # Show the manual.
28 services.nixosManual.showManual = true;
29
30 # Let the user play Rogue on TTY 8 during the installation.
31 services.rogue.enable = true;
32
33 # Disable some other stuff we don't need.
34 security.sudo.enable = false;
35
36 # Automatically log in at the virtual consoles.
37 services.mingetty.autologinUser = "root";
38
39 # Some more help text.
40 services.mingetty.helpLine =
41 ''
42
43 The "root" account has an empty password. ${
44 optionalString config.services.xserver.enable
45 "Type `systemctl start display-manager' to\nstart the graphical user interface."}
46 '';
47
48 # Allow sshd to be started manually through "start sshd".
49 services.openssh.enable = true;
50 systemd.services.sshd.wantedBy = mkOverride 50 [];
51
52 # Enable wpa_supplicant, but don't start it by default.
53 networking.wireless.enable = mkDefault true;
54 systemd.services.wpa_supplicant.wantedBy = mkOverride 50 [];
55
56 # Tell the Nix evaluator to garbage collect more aggressively.
57 # This is desirable in memory-constrained environments that don't
58 # (yet) have swap set up.
59 environment.variables.GC_INITIAL_HEAP_SIZE = "100000";
60
61 # Make the installer more likely to succeed in low memory
62 # environments. The kernel's overcommit heustistics bite us
63 # fairly often, preventing processes such as nix-worker or
64 # download-using-manifests.pl from forking even if there is
65 # plenty of free memory.
66 boot.kernel.sysctl."vm.overcommit_memory" = "1";
67
68 # To speed up installation a little bit, include the complete
69 # stdenv in the Nix store on the CD. Archive::Cpio is needed for
70 # the initrd builder.
71 system.extraDependencies = [ pkgs.stdenv pkgs.busybox pkgs.perlPackages.ArchiveCpio ];
72
73 };
74}