diff --git a/modules/installer/cd-dvd/installation-cd-base.nix b/modules/installer/cd-dvd/installation-cd-base.nix index 3a4f2965d00..e8d51da090d 100644 --- a/modules/installer/cd-dvd/installation-cd-base.nix +++ b/modules/installer/cd-dvd/installation-cd-base.nix @@ -74,7 +74,10 @@ in [ options ./memtest.nix ./iso-image.nix + + # Profiles of this basic installation CD. ../../profiles/base.nix + ../../profiles/installation-device.nix # Enable devices which are usually scanned, because we don't know the # target system. @@ -87,30 +90,10 @@ in isoImage.volumeID = "NIXOS_INSTALL_CD_${config.system.nixosVersion}"; - # 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; - - # Include only the en_US locale. This saves 75 MiB or so compared to - # the full glibcLocales package. - i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "en_US/ISO-8859-1"]; - - # nixos-install will do a pull from this channel to speed up the - # installation. - installer.nixpkgsURL = http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable; - boot.postBootCommands = '' export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH - # Provide a mount point for nixos-install. - mkdir -p /mnt - # Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required # for nixos-install. ${optionalString includeSources '' @@ -128,17 +111,6 @@ in cp ${dummyConfiguration} /etc/nixos/configuration.nix ''; - # Some more help text. - services.mingetty.helpLine = - '' - - Log in as "root" with an empty password. ${ - if config.services.xserver.enable then - "Type `start xserver' to start\nthe graphical user interface." - else "" - } - ''; - # To speed up installation a little bit, include the complete stdenv # in the Nix store on the CD. isoImage.storeContents = [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ]; diff --git a/modules/profiles/installation-device.nix b/modules/profiles/installation-device.nix new file mode 100644 index 00000000000..54ce32eb0e8 --- /dev/null +++ b/modules/profiles/installation-device.nix @@ -0,0 +1,48 @@ +{config, pkgs, ...}: + +{ + # 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; + + # Include only the en_US locale. This saves 75 MiB or so compared to + # the full glibcLocales package. + i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "en_US/ISO-8859-1"]; + + # nixos-install will do a pull from this channel to speed up the + # installation. + installer.nixpkgsURL = http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable; + + boot.postBootCommands = + '' + # Provide a mount point for nixos-install. + mkdir -p /mnt + ''; + + # Some more help text. + services.mingetty.helpLine = + '' + + Log in as "root" with an empty password. ${ + if config.services.xserver.enable then + "Type `start xserver' to start\nthe graphical user interface." + else "" + } + ''; + + + # Allow sshd to be started manually through "start sshd". It should + # not be started by default on the installation CD because the + # default root password is empty. + services.openssh.enable = true; + jobs.sshd.startOn = pkgs.lib.mkOverride 50 ""; + + # Enable wpa_supplicant, but don't start it by default. + networking.enableWLAN = true; + jobs.wpa_supplicant.startOn = pkgs.lib.mkOverride 50 ""; +} \ No newline at end of file