1 # Provide a basic configuration for installation devices like CDs.
2 { config, pkgs, lib, ... }:
8 [ # Enable devices which are usually scanned, because we don't know the
10 ../installer/scan/detected.nix
11 ../installer/scan/not-detected.nix
13 # Allow "nixos-rebuild" to work properly by providing
14 # /etc/nixos/configuration.nix.
17 # Include a copy of Nixpkgs so that nixos-install works out of
19 ../installer/cd-dvd/channel.nix
24 # Enable in installer, even if the minimal profile disables it.
25 documentation.enable = mkImageMediaOverride true;
28 documentation.nixos.enable = mkImageMediaOverride true;
30 # Use less privileged nixos user
33 extraGroups = [ "wheel" "networkmanager" "video" ];
34 # Allow the graphical user to login without password
35 initialHashedPassword = "";
38 # Allow the user to log in as root without a password.
39 users.users.root.initialHashedPassword = "";
41 # Allow passwordless sudo from nixos user
43 enable = mkDefault true;
44 wheelNeedsPassword = mkImageMediaOverride false;
47 # Automatically log in at the virtual consoles.
48 services.getty.autologinUser = "nixos";
50 # Some more help text.
51 services.getty.helpLine = ''
52 The "nixos" and "root" accounts have empty passwords.
54 An ssh daemon is running. You then must set a password
55 for either "root" or "nixos" with `passwd` or add an ssh key
56 to /home/nixos/.ssh/authorized_keys be able to login.
58 If you need a wireless connection, type
59 `sudo systemctl start wpa_supplicant` and configure a
60 network using `wpa_cli`. See the NixOS manual for details.
61 '' + optionalString config.services.xserver.enable ''
63 Type `sudo systemctl start display-manager' to
64 start the graphical user interface.
67 # We run sshd by default. Login via root is only possible after adding a
68 # password via "passwd" or by adding a ssh key to /home/nixos/.ssh/authorized_keys.
69 # The latter one is particular useful if keys are manually added to
70 # installation device for head-less systems i.e. arm boards by manually
71 # mounting the storage in a different system.
74 permitRootLogin = "yes";
77 # Enable wpa_supplicant, but don't start it by default.
78 networking.wireless.enable = mkDefault true;
79 networking.wireless.userControlled.enable = true;
80 systemd.services.wpa_supplicant.wantedBy = mkOverride 50 [];
82 # Tell the Nix evaluator to garbage collect more aggressively.
83 # This is desirable in memory-constrained environments that don't
84 # (yet) have swap set up.
85 environment.variables.GC_INITIAL_HEAP_SIZE = "1M";
87 # Make the installer more likely to succeed in low memory
88 # environments. The kernel's overcommit heustistics bite us
89 # fairly often, preventing processes such as nix-worker or
90 # download-using-manifests.pl from forking even if there is
91 # plenty of free memory.
92 boot.kernel.sysctl."vm.overcommit_memory" = "1";
94 # To speed up installation a little bit, include the complete
95 # stdenv in the Nix store on the CD.
96 system.extraDependencies = with pkgs;
99 stdenvNoCC # for runCommand
102 # For boot.initrd.systemd
108 # Show all debug messages from the kernel but don't log refused packets
109 # because we have the firewall enabled. This makes installs from the
110 # console less cumbersome if the machine has a public IP.
111 networking.firewall.logRefusedConnections = mkDefault false;
113 # Prevent installation media from evacuating persistent storage, as their
114 # var directory is not persistent and it would thus result in deletion of
116 environment.etc."systemd/pstore.conf".text = ''