2011-11-08 15:58:59 +00:00
|
|
|
# Provide a basic configuration for installation devices like CDs.
|
2015-06-10 11:04:26 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
2010-09-25 10:32:43 +01:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2010-09-25 10:32:43 +01:00
|
|
|
|
2010-09-25 10:32:48 +01:00
|
|
|
{
|
2013-07-03 12:58:38 +01:00
|
|
|
imports =
|
|
|
|
[ # Enable devices which are usually scanned, because we don't know the
|
|
|
|
# target system.
|
|
|
|
../installer/scan/detected.nix
|
|
|
|
../installer/scan/not-detected.nix
|
2010-09-25 10:32:52 +01:00
|
|
|
|
2013-07-03 12:58:38 +01:00
|
|
|
# Allow "nixos-rebuild" to work properly by providing
|
|
|
|
# /etc/nixos/configuration.nix.
|
|
|
|
./clone-config.nix
|
2015-06-10 11:04:26 +01:00
|
|
|
|
|
|
|
# Include a copy of Nixpkgs so that nixos-install works out of
|
|
|
|
# the box.
|
|
|
|
../installer/cd-dvd/channel.nix
|
2013-07-03 12:58:38 +01:00
|
|
|
];
|
2010-09-25 10:32:48 +01:00
|
|
|
|
|
|
|
config = {
|
|
|
|
|
2015-06-10 11:04:26 +01:00
|
|
|
# Enable in installer, even if the minimal profile disables it.
|
|
|
|
services.nixosManual.enable = mkForce true;
|
|
|
|
|
2010-09-25 10:32:48 +01:00
|
|
|
# Show the manual.
|
|
|
|
services.nixosManual.showManual = true;
|
|
|
|
|
|
|
|
# Let the user play Rogue on TTY 8 during the installation.
|
|
|
|
services.rogue.enable = true;
|
|
|
|
|
|
|
|
# Disable some other stuff we don't need.
|
|
|
|
security.sudo.enable = false;
|
|
|
|
|
2015-04-14 10:48:09 +01:00
|
|
|
# Automatically log in at the virtual consoles.
|
|
|
|
services.mingetty.autologinUser = "root";
|
|
|
|
|
2010-09-25 10:32:48 +01:00
|
|
|
# Some more help text.
|
|
|
|
services.mingetty.helpLine =
|
|
|
|
''
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2015-04-14 10:48:09 +01:00
|
|
|
The "root" account has an empty password. ${
|
2013-01-22 11:52:13 +00:00
|
|
|
optionalString config.services.xserver.enable
|
|
|
|
"Type `start display-manager' to\nstart the graphical user interface."}
|
2010-09-25 10:32:48 +01:00
|
|
|
'';
|
2010-09-25 10:32:43 +01:00
|
|
|
|
2013-07-09 14:59:57 +01:00
|
|
|
# Allow sshd to be started manually through "start sshd".
|
2010-09-25 10:32:48 +01:00
|
|
|
services.openssh.enable = true;
|
2013-07-09 15:12:34 +01:00
|
|
|
systemd.services.sshd.wantedBy = mkOverride 50 [];
|
2010-09-25 10:32:43 +01:00
|
|
|
|
2010-09-25 10:32:48 +01:00
|
|
|
# Enable wpa_supplicant, but don't start it by default.
|
2015-06-10 11:04:26 +01:00
|
|
|
networking.wireless.enable = mkDefault true;
|
2014-04-14 15:26:48 +01:00
|
|
|
jobs.wpa_supplicant.startOn = mkOverride 50 "";
|
2012-04-23 01:41:37 +01:00
|
|
|
|
|
|
|
# Tell the Nix evaluator to garbage collect more aggressively.
|
|
|
|
# This is desirable in memory-constrained environments that don't
|
|
|
|
# (yet) have swap set up.
|
2013-09-23 22:03:21 +01:00
|
|
|
environment.variables.GC_INITIAL_HEAP_SIZE = "100000";
|
2013-09-18 04:18:34 +01:00
|
|
|
|
2015-06-10 11:04:26 +01:00
|
|
|
# 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 ];
|
|
|
|
|
2010-09-25 10:32:48 +01:00
|
|
|
};
|
|
|
|
}
|