diff --git a/configuration/live-dvd.nix b/configuration/live-dvd.nix index e876247df8c8..17ffc5d6358d 100644 --- a/configuration/live-dvd.nix +++ b/configuration/live-dvd.nix @@ -14,6 +14,7 @@ rec { readOnlyRoot = true; # The label used to identify the installation CD. rootLabel = "NIXOS"; + extraTTYs = [7 8]; # manual, rogue }; services = { @@ -45,6 +46,15 @@ rec { "; } + # Show the NixOS manual on tty7. + { name = "manual"; + job = " + start on udev + stop on shutdown + respawn ${pkgs.w3m}/bin/w3m ${manual} < /dev/tty7 > /dev/tty7 2>&1 + "; + } + # Allow the user to do something useful on tty8 while waiting # for the installation to finish. { name = "rogue"; @@ -59,6 +69,13 @@ rec { # And a background to go with that. ttyBackgrounds = { specificThemes = [ + { tty = 7; + # Theme is GPL according to http://kde-look.org/content/show.php/Green?content=58501. + theme = pkgs.fetchurl { + url = http://www.kde-look.org/CONTENT/content-files/58501-green.tar.gz; + sha256 = "0sdykpziij1f3w4braq8r8nqg4lnsd7i7gi1k5d7c31m2q3b9a7r"; + }; + } { tty = 8; theme = pkgs.fetchurl { url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2; @@ -67,6 +84,13 @@ rec { } ]; }; + + mingetty = { + helpLine = '' + + Log in as "root" with an empty password. Press for help. + ''; + }; }; @@ -151,7 +175,15 @@ rec { pkgs = system.pkgs; - + + + # The NixOS manual, with a backward compatibility hack for Nix <= + # 0.11 (you won't get the manual). + manual = + if builtins ? unsafeDiscardStringContext + then "${import ../doc/manual}/manual.html" + else pkgs.writeText "dummy-manual" "Manual not included in this build!"; + # Since the CD is read-only, the mount points must be on disk. cdMountPoints = pkgs.runCommand "mount-points" {} " @@ -216,7 +248,7 @@ rec { # Create an ISO image containing the Grub boot loader, the kernel, # the initrd produced above, and the closure of the stage 2 init. rescueCD = import ../helpers/make-iso9660-image.nix { - inherit (pkgs) stdenv perl cdrtools; + inherit (pkgs) stdenv perl cdrkit; isoName = "nixos-${platform}.iso"; # Single files to be copied to fixed locations on the CD. @@ -236,10 +268,7 @@ rec { { source = pkgs.memtest86 + "/memtest.bin"; target = "boot/memtest.bin"; } - { source = pkgs.fetchurl { - url = http://www.gnome-look.org/CONTENT/content-files/36909-soft-tux.xpm.gz; - sha256 = "14kqdx2lfqvh40h6fjjzqgff1mwk74dmbjvmqphi6azzra7z8d59"; - }; + { source = system.config.boot.grubSplashImage; target = "boot/background.xpm.gz"; } { source = cdMountPoints; diff --git a/etc/default.nix b/etc/default.nix index 499376d1e8f5..6bf0b42c9e41 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -1,5 +1,6 @@ { config, pkgs, upstartJobs, systemPath, wrapperDir , defaultShell, extraEtc, nixEnvVars +, kernel ? null }: let @@ -25,7 +26,6 @@ let pamConsolePerms = ./security/console.perms; - in @@ -109,10 +109,12 @@ import ../helpers/make-etc.nix { source = pkgs.substituteAll { src = ./profile.sh; inherit systemPath wrapperDir; - inherit (pkgs) systemKernel glibc; + inherit (pkgs) glibc; timeZone = config.time.timeZone; defaultLocale = config.i18n.defaultLocale; inherit nixEnvVars; + systemKernel = (if kernel == null then + pkgs.systemKernel else kernel); }; target = "profile"; } diff --git a/etc/profile.sh b/etc/profile.sh index 992f23afabab..832ea5cccb04 100644 --- a/etc/profile.sh +++ b/etc/profile.sh @@ -11,6 +11,7 @@ export EDITOR=nano # A nice prompt. PROMPT_COLOR="1;31m" +let $UID && PROMPT_COLOR="1;32m" PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]$\[\033[0m\] " if test "x$TERM" == "xxterm"; then PS1="\033]2;\h:\u:\w\007$PS1" diff --git a/system/system.nix b/system/system.nix index 9dbfef0c0b32..9b655e0a4956 100644 --- a/system/system.nix +++ b/system/system.nix @@ -172,6 +172,7 @@ rec { etc = import ../etc/default.nix { inherit config pkgs upstartJobs systemPath wrapperDir defaultShell nixEnvVars; + inherit kernel; extraEtc = pkgs.lib.concatLists (map (job: job.extraEtc) upstartJobs.jobs); };