From 5c165ad81534c96344ea67abacc58453c757e65d Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 14 Apr 2009 13:45:57 +0000 Subject: [PATCH 01/53] Added vboxdrv to udev in order to have proper permissions svn path=/nixos/trunk/; revision=15032 --- upstart-jobs/udev.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/upstart-jobs/udev.nix b/upstart-jobs/udev.nix index 4662adde222..ae4fd6c653d 100644 --- a/upstart-jobs/udev.nix +++ b/upstart-jobs/udev.nix @@ -20,6 +20,7 @@ let KERNEL=="sonypi", MODE="0666" KERNEL=="kvm", MODE="0666" KERNEL=="kqemu", NAME="%k", MODE="0666" + KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0666" # Create symlinks for CD/DVD devices. ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", SYMLINK+="cdrom cdrom-%k" From ee3393df8d42379e62b2d8081d3cbb7d87a40016 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Apr 2009 09:57:38 +0000 Subject: [PATCH 02/53] * Creating /var/spool/whatever fails if /var/spool doesn't exist. svn path=/nixos/trunk/; revision=15058 --- upstart-jobs/atd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstart-jobs/atd.nix b/upstart-jobs/atd.nix index 310477d1994..59fd4789148 100644 --- a/upstart-jobs/atd.nix +++ b/upstart-jobs/atd.nix @@ -40,7 +40,7 @@ start script do if [ ! -d "$dir" ] then - mkdir "$dir" && chown atd:atd "$dir" + mkdir -p "$dir" && chown atd:atd "$dir" fi done chmod 1770 "$spooldir" "$jobdir" From 7409bb9ec1363cb036d7c4a8f4df5ed6742c70fe Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Apr 2009 10:13:37 +0000 Subject: [PATCH 03/53] * Use Linux 2.6.28 on the installation CD. svn path=/nixos/trunk/; revision=15061 --- installer/cd-dvd/rescue-cd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index ffa8fa875d1..045e54057a4 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -20,7 +20,7 @@ rec { extraTTYs = [7 8]; # manual, rogue extraModulePackages = [system.kernelPackages.aufs]; - kernelPackages = pkgs.kernelPackages_2_6_25; + kernelPackages = pkgs.kernelPackages_2_6_28; initrd = { extraKernelModules = [ From 723be3579d6001c307e40b379d693673df3f1b15 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Apr 2009 11:51:37 +0000 Subject: [PATCH 04/53] * Remove gdb from the CD. svn path=/nixos/trunk/; revision=15062 --- installer/cd-dvd/rescue-cd.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 045e54057a4..2a5c17199ba 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -187,7 +187,6 @@ rec { pkgs.vim pkgs.subversion # for nixos-checkout pkgs.w3m # needed for the manual anyway - pkgs.gdb # for debugging Nix pkgs.testdisk # useful for repairing boot problems pkgs.mssys # for writing Microsoft boot sectors / MBRs pkgs.ntfsprogs # for resizing NTFS partitions From 760f484e4dfd2d560c0e5e31c3300be01d002f2c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 Apr 2009 08:24:38 +0000 Subject: [PATCH 05/53] * Removed some more stuff from the CD because the x86_64-linux ISO is over 700 MB. (Maybe vim could be replaced by a smaller vi?) Note that the main size problem for the x86_64-linux ISO is that it contains two Glibcs - Grub has a dependency on the 32-bit Glibc. It would be nice to get rid of that. svn path=/nixos/trunk/; revision=15074 --- installer/cd-dvd/rescue-cd.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 2a5c17199ba..8523246ae17 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -184,14 +184,12 @@ rec { environment = { extraPackages = [ - pkgs.vim pkgs.subversion # for nixos-checkout pkgs.w3m # needed for the manual anyway pkgs.testdisk # useful for repairing boot problems pkgs.mssys # for writing Microsoft boot sectors / MBRs pkgs.ntfsprogs # for resizing NTFS partitions pkgs.sshfsFuse - pkgs.screen ]; }; From 4f3d55232aab6e9a2f6c26bb87515c60ed7bd076 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 Apr 2009 13:29:22 +0000 Subject: [PATCH 06/53] * Don't do a sync, they're incredibly expensive. (I just had one that took 25 minutes to complete...) svn path=/nixos/trunk/; revision=15086 --- system/switch-to-configuration.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/system/switch-to-configuration.sh b/system/switch-to-configuration.sh index 593dd61714e..dcca984282b 100644 --- a/system/switch-to-configuration.sh +++ b/system/switch-to-configuration.sh @@ -85,5 +85,3 @@ if test "$action" = "switch" -o "$action" = "test"; then fi done fi - -sync From ed43363e2a2ffc019370df43c4861988d29520d6 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 19 Apr 2009 10:36:30 +0000 Subject: [PATCH 07/53] following renaming whatis -> showVal svn path=/nixos/trunk/; revision=15145 --- installer/nixos-checkout.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/nixos-checkout.nix b/installer/nixos-checkout.nix index 4fedbd4d9c7..79e69757685 100644 --- a/installer/nixos-checkout.nix +++ b/installer/nixos-checkout.nix @@ -1,6 +1,6 @@ args : with args; let - inherit (pkgs.lib) id all whatis escapeShellArg concatMapStrings concatMap + inherit (pkgs.lib) id all showVal escapeShellArg concatMapStrings concatMap mapAttrs concatLists flattenAttrs filter; inherit (builtins) getAttr hasAttr head isAttrs; in @@ -18,7 +18,7 @@ rec { assert (isAttrs attrs); assert (repo + "" == repo); # assert repo is a string if (! (attrs ? type)) then - throw "repo type is missing of : ${whatis attrs}" + throw "repo type is missing of : ${showVal attrs}" # prepare svn repo else if attrs.type == "svn" then let a = { # add svn defaults From 453e9abc9e6689d775fd1766402fdb994089efba Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Apr 2009 16:26:50 +0000 Subject: [PATCH 08/53] * Work around an apparent bug in Bash 4.0. It no longer accepts this: echo $(cat <> $tmp From 9940de0088cd88cd12cb06015f6851762ddeca93 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Apr 2009 08:03:05 +0000 Subject: [PATCH 09/53] * After upgrading to X.org server 1.5.3, we suddenly need to set "AllowEmptyInput" to "off", otherwise we get no keyboard or mouse. The logfile then says: (WW) AllowEmptyInput is on, devices using drivers 'kbd' or 'mouse' will be disabled. (WW) Disabling Keyboard[0] (WW) Disabling Mouse[0] which seems rather weird. svn path=/nixos/trunk/; revision=15204 --- upstart-jobs/xserver.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index 36e9da8bf0f..b1d3a11e97b 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -9,6 +9,7 @@ EndSection Section "ServerFlags" Option "AllowMouseOpenFail" "on" + Option "AllowEmptyInput" "off" EndSection From 31ff856a52ffba681f9e388a04c078f03b4fd9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20L=C3=B6h?= Date: Tue, 21 Apr 2009 11:29:40 +0000 Subject: [PATCH 10/53] Updated reference to xmonad. svn path=/nixos/trunk/; revision=15208 --- upstart-jobs/xserver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 772b8f214f0..38451046998 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -265,7 +265,7 @@ let '' else if windowManager == "xmonad" then '' - ${pkgs.xmonad}/bin/xmonad & + ${pkgs.haskellPackages.xmonad}/bin/xmonad & '' else if windowManager == "none" then '' From 3a7834dcac619d81c8b731554a5873a995e501bd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Apr 2009 12:38:13 +0000 Subject: [PATCH 11/53] * Use perlPackages. svn path=/nixos/trunk/; revision=15211 --- upstart-jobs/apache-httpd/subversion.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/upstart-jobs/apache-httpd/subversion.nix b/upstart-jobs/apache-httpd/subversion.nix index 8a48617ee44..a32e0bf5dbd 100644 --- a/upstart-jobs/apache-httpd/subversion.nix +++ b/upstart-jobs/apache-httpd/subversion.nix @@ -54,9 +54,11 @@ let # Urgh, most of these are dependencies of Email::Send, should figure them out automatically. perlFlags = map (x: "-I${x}/lib/site_perl") [ - pkgs.perlBerkeleyDB pkgs.perlEmailSend pkgs.perlEmailSimple - pkgs.perlModulePluggable pkgs.perlReturnValue pkgs.perlEmailAddress - pkgs.perlCryptPasswordMD5 pkgs.perlStringMkPasswd + pkgs.perlPackages.BerkeleyDB pkgs.perlPackages.EmailSend + pkgs.perlPackages.EmailSimple pkgs.perlPackages.ModulePluggable + pkgs.perlPackages.ReturnValue pkgs.perlPackages.EmailAddress + pkgs.perlPackages.CryptPasswordMD5 + pkgs.perlPackages.StringMkPasswd ]; # Do a syntax check on the generated file. From 5ac2532cc79ce988ff5f82c56e0f5a01e58f6b5a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Apr 2009 12:56:17 +0000 Subject: [PATCH 12/53] * Add GNU parted to the CD. svn path=/nixos/trunk/; revision=15274 --- installer/cd-dvd/rescue-cd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 8523246ae17..b7e68c2d46d 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -189,6 +189,7 @@ rec { pkgs.testdisk # useful for repairing boot problems pkgs.mssys # for writing Microsoft boot sectors / MBRs pkgs.ntfsprogs # for resizing NTFS partitions + pkgs.parted pkgs.sshfsFuse ]; }; From d9f4475dd55dba9adfa28d83caeee6b320d3e3e7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 25 Apr 2009 22:36:56 +0000 Subject: [PATCH 13/53] * Be able to cope with future changes to Upstart. svn path=/nixos/trunk/; revision=15312 --- system/options.nix | 2 +- system/switch-to-configuration.sh | 12 ++++++++++++ system/system.nix | 1 + system/system.sh | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index 0c0554897ee..9ce0daf9de7 100644 --- a/system/options.nix +++ b/system/options.nix @@ -847,7 +847,7 @@ in gatewayPorts = mkOption { default = "no"; description = " - Specifies whether remote hosts are allowed to connect to ports forwarded for the client. See man sshd_conf. + Specifies whether remote hosts are allowed to connect to ports forwarded for the client. See man sshd_conf. "; }; }; diff --git a/system/switch-to-configuration.sh b/system/switch-to-configuration.sh index dcca984282b..eaeb3106afd 100644 --- a/system/switch-to-configuration.sh +++ b/system/switch-to-configuration.sh @@ -35,6 +35,18 @@ fi if test "$action" = "switch" -o "$action" = "test"; then + oldVersion=$(cat /var/run/current-system/upstart-interface-version 2> /dev/null || echo 0) + newVersion=$(cat @out@/upstart-interface-version 2> /dev/null || echo 0) + + if test "$oldVersion" -ne "$newVersion"; then + cat < $out/kernel-params echo "$configurationName" > $out/configuration-name +echo "$upstartInterfaceVersion" > $out/upstart-interface-version mkdir $out/fine-tune ChildCount=0; From b891792ddd6c07c8c9f588bda0cc691909db70b8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 26 Apr 2009 21:06:00 +0000 Subject: [PATCH 14/53] * Hack to make desktop locking in KDE 3 work. svn path=/nixos/trunk/; revision=15326 --- upstart-jobs/xserver.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 38451046998..7d1d63160d0 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -289,6 +289,15 @@ let ### Start the session. ${if sessionType == "kde" then '' + # A quick hack to make KDE screen locking work. It calls + # kcheckpass, which needs to be setuid in order to read the + # shadow password file. We have a setuid wrapper around + # kcheckpass. However, startkde adds $kdebase/bin to the start + # of $PATH if it's not already in $PATH, thus overriding the + # setuid wrapper directory. So here we add $kdebase/bin to the + # end of $PATH to keep startkde from doing that. + export PATH=$PATH:${pkgs.kdebase}/bin + # Start KDE. exec ${pkgs.kdebase}/bin/startkde From 7da8137f187800084d8c87c7cd5c159fb371d134 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Apr 2009 21:52:10 +0000 Subject: [PATCH 15/53] * Re-enable Glibc locales. svn path=/nixos/trunk/; revision=15340 --- etc/bashrc.sh | 1 + system/system.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/etc/bashrc.sh b/etc/bashrc.sh index 1a2b45794d9..ba8a0ebb9c6 100644 --- a/etc/bashrc.sh +++ b/etc/bashrc.sh @@ -18,6 +18,7 @@ export LOCATE_PATH=/var/cache/locatedb export KDEDIRS=@kdeDirs@ export XDG_CONFIG_DIRS=@xdgConfigDirs@ export XDG_DATA_DIRS=@xdgDataDirs@ +export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive # Set up secure multi-user builds: non-root users build through the diff --git a/system/system.nix b/system/system.nix index c00704df020..ed7967c5f63 100644 --- a/system/system.nix +++ b/system/system.nix @@ -192,6 +192,7 @@ rec { pkgs.e2fsprogs pkgs.findutils pkgs.glibc # for ldd, getent + pkgs.glibcLocales pkgs.gnugrep pkgs.gnused pkgs.gnutar From dca798111128ea1d8c4e40448b1124bc721bd2cc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Apr 2009 23:09:25 +0000 Subject: [PATCH 16/53] * Make sure that the FDI cache is flushed on startup. Mine had a timestamp somewhere in 2008, so apparently it's not getting updated. svn path=/nixos/trunk/; revision=15344 --- upstart-jobs/hal.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upstart-jobs/hal.nix b/upstart-jobs/hal.nix index af4038f0fe0..786edd81849 100644 --- a/upstart-jobs/hal.nix +++ b/upstart-jobs/hal.nix @@ -30,6 +30,8 @@ mkdir -m 0755 -p /var/cache/hald + rm -f /var/cache/hald/fdi-cache + end script respawn ${hal}/sbin/hald --daemon=no From 1723eaec3d4f702d4e4c7241e97b406146631e01 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Apr 2009 23:19:31 +0000 Subject: [PATCH 17/53] * Use evdev instead of the deprecated keyboard/mouse drivers. Note: evdev gets the keyboard layout / model from HAL (`lshal | grep xkb'), but we don't yet have a way to override the default (`us'). svn path=/nixos/trunk/; revision=15345 --- upstart-jobs/xserver.conf | 23 +++-------------------- upstart-jobs/xserver.nix | 17 ++++++++--------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index b1d3a11e97b..5ac2b12d7c5 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -7,9 +7,9 @@ Section "Files" @modulePaths@ EndSection + Section "ServerFlags" Option "AllowMouseOpenFail" "on" - Option "AllowEmptyInput" "off" EndSection @@ -22,25 +22,9 @@ Section "Module" EndSection -Section "InputDevice" - Driver "kbd" - Identifier "Keyboard[0]" - Option "Protocol" "Standard" - Option "XkbLayout" "@layout@" - Option "XkbModel" "@xkbModel@" - Option "XkbRules" "xfree86" - @xkbOptions@ -EndSection - - -Section "InputDevice" - Driver "mouse" - Identifier "Mouse[0]" - Option "Device" "/dev/input/mice" -EndSection - @synapticsInputDevice@ + Section "Monitor" Identifier "Monitor[0]" Option "DPMS" @@ -89,8 +73,7 @@ EndSection Section "ServerLayout" Identifier "Layout[all]" - InputDevice "Keyboard[0]" "CoreKeyboard" - InputDevice "@corePointer@" "CorePointer" + @setCorePointer@ Screen "Screen[0]" @serverLayoutOptions@ EndSection diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 7d1d63160d0..062faa06db3 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -32,8 +32,9 @@ let resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions); sessionType = cfg.sessionType; - videoDriverModules = getAttr [ videoDriver ] (throw "unkown video driver : \"${videoDriver}\"") knownVideoDrivers; + videoDriverModules = getAttr [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; + sessionCmd = if sessionType == "" then cfg.sessionStarter else if sessionType == "xterm" then "${pkgs.xterm}/bin/xterm -ls" else @@ -51,13 +52,11 @@ let modules = - getAttr ["modulesFirst"] [] videoDriverModules ++ [ xorg.xorgserver - xorg.xf86inputkeyboard - xorg.xf86inputmouse - ] + xorg.xf86inputevdev + ] ++ getAttr ["modules"] [] videoDriverModules ++ (optional cfg.synaptics.enable ["${pkgs.synaptics}/${xorg.xorgserver}" /*xorg.xf86inputevdev*/]); @@ -113,10 +112,10 @@ let Option "XkbOptions" "${cfg.xkbOptions}" ''; - xkbModel = cfg.xkbModel; - layout = cfg.layout; - - corePointer = if cfg.synaptics.enable then "Touchpad[0]" else "Mouse[0]"; + setCorePointer = + if cfg.synaptics.enable then '' + InputDevice "Touchpad[0]" "CorePointer" + '' else ""; internalAGPGART = if cfg.useInternalAGPGART == "yes" then From bf04b4c7dcde3d8567be63fd45e3b71dc32d5374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 28 Apr 2009 07:58:20 +0000 Subject: [PATCH 18/53] Making xserver cope with new evdev input device, and the proper dri mesa driver directory. svn path=/nixos/trunk/; revision=15346 --- upstart-jobs/xserver.conf | 1 + upstart-jobs/xserver.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index 5ac2b12d7c5..a8d2a70dfac 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -76,6 +76,7 @@ Section "ServerLayout" @setCorePointer@ Screen "Screen[0]" @serverLayoutOptions@ + Option "AutoAddDevices" "0" EndSection diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 062faa06db3..91b30828f7e 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -58,7 +58,7 @@ let xorg.xf86inputevdev ] ++ getAttr ["modules"] [] videoDriverModules - ++ (optional cfg.synaptics.enable ["${pkgs.synaptics}/${xorg.xorgserver}" /*xorg.xf86inputevdev*/]); + ++ (optional cfg.synaptics.enable ["${xorg.xf86inputsynaptics}"]); fontsForXServer = @@ -447,7 +447,7 @@ rec { } ${if videoDriver != "nvidia" - then "env XORG_DRI_DRIVER_PATH=${pkgs.mesa}/lib/modules/dri" + then "env XORG_DRI_DRIVER_PATH=${pkgs.mesa}/lib/dri" else "" } From 38d7e7b780afb9ba9b7bee3a0c5783bb4ed3f69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 28 Apr 2009 08:47:13 +0000 Subject: [PATCH 19/53] Sorry, I disabled X hal config in my last commit, thinking it was still not usable. I see the problem rests only in configuring the keyboard layout in hal, for X. Nevertheless, using the client "setxkbmap" works, which can help until we can configure the keyboard layout in configuration.nix. svn path=/nixos/trunk/; revision=15348 --- upstart-jobs/xserver.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index a8d2a70dfac..978b8739052 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -76,7 +76,8 @@ Section "ServerLayout" @setCorePointer@ Screen "Screen[0]" @serverLayoutOptions@ - Option "AutoAddDevices" "0" + # If you want to disable HAL-based configuration, set AutoAddDevices to 0 + # Option "AutoAddDevices" "0" EndSection From 2cd1e7239fdbf60eea564c9183a6e31c03fca25e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Apr 2009 13:43:03 +0000 Subject: [PATCH 20/53] * Atomically update grub/menu.lst (although we really need an fsync here). svn path=/nixos/trunk/; revision=15368 --- installer/grub-menu-builder.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 5d26cdb4327..72635c36433 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -147,4 +147,6 @@ for generation in $( done -cp $tmp $target +# Atomically update /boot/grub/menu.lst. !!! should do an fsync() +# here on $tmp, especially on ext4. +mv $tmp $target From 114109b709cc1331e5eaf8c5f794c4f81e371b06 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Apr 2009 13:43:22 +0000 Subject: [PATCH 21/53] * The X server now needs HAL running. svn path=/nixos/trunk/; revision=15369 --- upstart-jobs/xserver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 91b30828f7e..504a06b8650 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -416,7 +416,7 @@ rec { job = '' - start on ${if cfg.autorun then "network-interfaces" else "never"} + start on ${if cfg.autorun then "hal" else "never"} start script From 0f99f50e3456ce225dea83ce414d340cfd5d0cb9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Apr 2009 13:43:48 +0000 Subject: [PATCH 22/53] * Use lib/perl5/site_perl. svn path=/nixos/trunk/; revision=15370 --- etc/bashrc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/bashrc.sh b/etc/bashrc.sh index ba8a0ebb9c6..38f839f4476 100644 --- a/etc/bashrc.sh +++ b/etc/bashrc.sh @@ -49,8 +49,10 @@ for i in $NIX_PROFILES; do # !!! reverse if [ -d "$i/share/aclocal" ]; then export ACLOCAL_PATH="$i/share/aclocal:$ACLOCAL_PATH" fi - - export PERL5LIB="$i/lib/site_perl:$PERL5LIB" + + # "lib/site_perl" is for backwards compatibility with packages + # from Nixpkgs <= 0.12. + export PERL5LIB="$i/lib/perl5/site_perl:$i/lib/site_perl:$PERL5LIB" # GStreamer. export GST_PLUGIN_PATH="$i/lib/gstreamer-0.10:$GST_PLUGIN_PATH" From e3ad6a6f5926a89dcf23a63cd5c4f0f985c05c0a Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 29 Apr 2009 12:25:25 +0000 Subject: [PATCH 23/53] Added enableTCPIP option for postgresql (defaults to false) to allow tcpip connections svn path=/nixos/trunk/; revision=15391 --- system/options.nix | 6 ++++++ upstart-jobs/postgresql.nix | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/system/options.nix b/system/options.nix index 9ce0daf9de7..20152ddc206 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2286,6 +2286,12 @@ in How to authorize users. Note: ident needs absolute trust to all allowed client hosts."; }; + enableTCPIP = mkOption { + default = false; + description = " + Whether to run PostgreSQL with -i flag to enable TCP/IP connections. + "; + }; }; diff --git a/upstart-jobs/postgresql.nix b/upstart-jobs/postgresql.nix index a37780678fc..83ab1d5962d 100644 --- a/upstart-jobs/postgresql.nix +++ b/upstart-jobs/postgresql.nix @@ -13,7 +13,7 @@ let in -{ +rec { name = "postgresql"; users = [ @@ -28,6 +28,9 @@ in extraPath = [postgresql]; + flags = + if cfg.enableTCPIP then ["-i"] else [] ; + job = '' description "PostgreSQL server" @@ -43,6 +46,6 @@ in cp -f ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf end script - respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir}' + respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir} ${toString flags}' ''; } From d29b8323e1ad3341d27619743172be6ae702aef5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Apr 2009 14:51:17 +0000 Subject: [PATCH 24/53] * Support loading the Intel 5000 firmware. svn path=/nixos/trunk/; revision=15396 --- system/options.nix | 9 +++++++++ upstart-jobs/default.nix | 1 + 2 files changed, 10 insertions(+) diff --git a/system/options.nix b/system/options.nix index 20152ddc206..ef73fcb7ec0 100644 --- a/system/options.nix +++ b/system/options.nix @@ -429,6 +429,15 @@ in "; }; + enableIntel5000Firmware = mkOption { + default = false; + merge = obsoleteMerge; + description = " + This option enables automatic loading of the firmware for the Intel + PRO/Wireless 5000. + "; + }; + enableZydasZD1211Firmware = mkOption { default = false; merge = obsoleteMerge; diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 9df21fb57a5..581ea53fee0 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -97,6 +97,7 @@ let pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw ++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode ++ pkgs.lib.optional config.networking.enableIntel4965AGNFirmware kernelPackages.iwlwifi4965ucode + ++ pkgs.lib.optional config.networking.enableIntel5000Firmware kernelPackages.iwlwifi5000ucode ++ pkgs.lib.optional config.networking.enableZydasZD1211Firmware pkgs.zd1211fw ++ pkgs.lib.optional config.hardware.enableGo7007 "${kernelPackages.wis_go7007}/firmware" ++ config.services.udev.addFirmware From 9325fa9ccc34db1fe0022f4f84249188915c5287 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 29 Apr 2009 15:10:14 +0000 Subject: [PATCH 25/53] iwlwifi5000ucode from pkgs svn path=/nixos/trunk/; revision=15397 --- upstart-jobs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 581ea53fee0..411fc526d41 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -97,7 +97,7 @@ let pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw ++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode ++ pkgs.lib.optional config.networking.enableIntel4965AGNFirmware kernelPackages.iwlwifi4965ucode - ++ pkgs.lib.optional config.networking.enableIntel5000Firmware kernelPackages.iwlwifi5000ucode + ++ pkgs.lib.optional config.networking.enableIntel5000Firmware pkgs.iwlwifi5000ucode ++ pkgs.lib.optional config.networking.enableZydasZD1211Firmware pkgs.zd1211fw ++ pkgs.lib.optional config.hardware.enableGo7007 "${kernelPackages.wis_go7007}/firmware" ++ config.services.udev.addFirmware From a29bfb0d7bf8f6cc0ca66f0dadbf136aaf13b330 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Apr 2009 17:03:29 +0000 Subject: [PATCH 26/53] * Use the default Subversion (1.6). svn path=/nixos/trunk/; revision=15407 --- upstart-jobs/apache-httpd/subversion.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upstart-jobs/apache-httpd/subversion.nix b/upstart-jobs/apache-httpd/subversion.nix index a32e0bf5dbd..3c3e7173549 100644 --- a/upstart-jobs/apache-httpd/subversion.nix +++ b/upstart-jobs/apache-httpd/subversion.nix @@ -19,7 +19,7 @@ let # Build a Subversion instance with Apache modules and Swig/Python bindings. - subversion = pkgs.subversion15.override (origArgs: { + subversion = pkgs.subversion.override (origArgs: { bdbSupport = true; httpServer = true; sslSupport = true; @@ -53,7 +53,7 @@ let inherit (serverInfo.serverConfig) user group; # Urgh, most of these are dependencies of Email::Send, should figure them out automatically. - perlFlags = map (x: "-I${x}/lib/site_perl") [ + perlFlags = map (x: "-I${x}/lib/perl5/site_perl") [ pkgs.perlPackages.BerkeleyDB pkgs.perlPackages.EmailSend pkgs.perlPackages.EmailSimple pkgs.perlPackages.ModulePluggable pkgs.perlPackages.ReturnValue pkgs.perlPackages.EmailAddress From ef64840085be2f457b3e21c71e989fcc3fe99f04 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Apr 2009 17:03:58 +0000 Subject: [PATCH 27/53] * Don't hardcode values specific to the program transformation / Stratego wikis. svn path=/nixos/trunk/; revision=15408 --- upstart-jobs/apache-httpd/twiki.nix | 50 +++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/upstart-jobs/apache-httpd/twiki.nix b/upstart-jobs/apache-httpd/twiki.nix index 54614aca24c..7e524144e64 100644 --- a/upstart-jobs/apache-httpd/twiki.nix +++ b/upstart-jobs/apache-httpd/twiki.nix @@ -3,10 +3,9 @@ let inherit (pkgs.lib) mkOption; - inherit (config) urlPrefix distDir; - dataDir = "/data/pt-wiki/data"; - pubDir = "/data/pt-wiki/pub"; + dataDir = config.dataDir; # "/data/pt-wiki/data"; + pubDir = config.pubDir; # "/data/pt-wiki/pub"; scriptUrlPath = "/bin"; pubUrlPath = "/pub"; @@ -17,19 +16,18 @@ let dispScriptUrlPath = ""; dispViewPath = ""; - twikiName = "Program Transformation Wiki"; startWeb = config.startWeb; - registrationDomain = "ewi.tudelft.nl"; defaultUrlHost = ""; # Build the TWiki CGI and configuration files. twikiRoot = (import /etc/nixos/services/twiki/twiki-instance.nix).twiki { - name = "pt-wiki"; + name = "wiki-instance"; pubdir = pubDir; datadir = dataDir; - inherit twikiName scriptUrlPath pubUrlPath absHostPath - dispPubUrlPath dispScriptUrlPath dispViewPath - registrationDomain defaultUrlHost; + inherit scriptUrlPath pubUrlPath absHostPath + dispPubUrlPath dispScriptUrlPath dispViewPath defaultUrlHost; + twikiName = config.twikiName; + registrationDomain = config.registrationDomain; }; plugins = import /etc/nixos/services/twiki/server-pkgs/twiki-plugins.nix; @@ -111,4 +109,38 @@ in { Disallow: /pt/bin/ ''; + options = { + + dataDir = mkOption { + example = "/data/wiki/data"; + description = " + Path to the directory that holds the Wiki data. + "; + }; + + pubDir = mkOption { + example = "/data/wiki/pub"; + description = " + Path to the directory that holds uploaded files. + "; + }; + + twikiName = mkOption { + default = "Wiki"; + example = "Foobar Wiki"; + description = " + Name of this Wiki. + "; + }; + + registrationDomain = mkOption { + example = "example.org"; + description = " + Domain from which registrations are permitted. Use `all' to + permit registrations from anywhere. + "; + }; + + }; + } \ No newline at end of file From 2470db9d7433280065684a692f47149d2bc70f65 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Thu, 30 Apr 2009 12:21:41 +0000 Subject: [PATCH 28/53] also add uhci_hcd, thanks to ugo @ irc svn path=/nixos/trunk/; revision=15413 --- installer/cd-dvd/rescue-cd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index b7e68c2d46d..7a5c97421bc 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -54,6 +54,7 @@ rec { # something goes wrong in stage 1. "ehci_hcd" "ohci_hcd" + "uhci_hcd" "usbhid" "usb_storage" From 9771cbbe2108e997baf32dadac5cb067fa24a08f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 2 May 2009 16:25:23 +0000 Subject: [PATCH 29/53] Set devpts mode: failing to do so yields trouble with 2.6.30-rc svn path=/nixos/trunk/; revision=15424 --- boot/boot-stage-2-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index a5f94bf2ad2..121cf46e12a 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -73,7 +73,7 @@ mount -t tmpfs -o "mode=0755" none /dev mkdir -m 0777 /dev/shm mount -t tmpfs -o "rw,nosuid,nodev" tmpfs /dev/shm mkdir -m 0755 -p /dev/pts -mount -t devpts none /dev/pts +mount -t devpts -o mode=0600 none /dev/pts [ -e /proc/bus/usb ] && mount -t usbfs none /proc/bus/usb # uml doesn't have usb by default mkdir -m 01777 -p /tmp mkdir -m 0755 -p /var From d90d3420ef77c8e63ddc5a71a434eab717963191 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 3 May 2009 11:07:28 +0000 Subject: [PATCH 30/53] Replace theme sources with gentoo distfiles svn path=/nixos/trunk/; revision=15427 --- system/options.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/system/options.nix b/system/options.nix index ef73fcb7ec0..2f96a426638 100644 --- a/system/options.nix +++ b/system/options.nix @@ -667,7 +667,7 @@ in defaultTheme = mkOption { default = pkgs.fetchurl { #url = http://www.bootsplash.de/files/themes/Theme-BabyTux.tar.bz2; - url = http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/Theme-BabyTux.tar.bz2; + url = mirror://gentoo/distfiles/Theme-BabyTux.tar.bz2; md5 = "a6d89d1c1cff3b6a08e2f526f2eab4e0"; }; description = " @@ -687,11 +687,7 @@ in } */ { tty = 10; - theme = pkgs.fetchurl { - #url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2; - url = http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/Theme-GNU.tar.bz2; - md5 = "61969309d23c631e57b0a311102ef034"; - }; + theme = pkgs.themes "theme-gnu"; } ]; description = " From 26e952582f9827817c08477355b58c74f3596ea4 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 3 May 2009 11:08:17 +0000 Subject: [PATCH 31/53] Export some configuration data about on-boot layout svn path=/nixos/trunk/; revision=15428 --- system/system.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system/system.nix b/system/system.nix index ed7967c5f63..2c60b82f066 100644 --- a/system/system.nix +++ b/system/system.nix @@ -379,6 +379,11 @@ rec { grubSplashImage bootMount configurationLimit; }; + children = map (x: ((import ./system.nix) + { inherit platform; + configuration = x//{boot=((x.boot)//{grubDevice = "";});};}).system) + config.nesting.children; + configurationName = config.boot.configurationName; # Putting it all together. This builds a store object containing # symlinks to the various parts of the built configuration (the @@ -398,6 +403,8 @@ rec { inherit grubMenuBuilder; inherit etc; inherit systemPath; + inherit children; + inherit configurationName; kernel = kernel + "/vmlinuz"; initrd = initialRamdisk + "/initrd"; # Most of these are needed by grub-install. @@ -415,11 +422,6 @@ rec { # when the parent configuration is boot default. For example, # you can provide an easy way to boot the same configuration # as you use, but with another kernel - children = map (x: ((import ./system.nix) - { inherit platform; - configuration = x//{boot=((x.boot)//{grubDevice = "";});};}).system) - config.nesting.children; - configurationName = config.boot.configurationName; }) config.environment.checkConfigurationOptions optionDeclarations config; From e4a174822618625f09a05983cd42560f56e47a5e Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 3 May 2009 11:37:20 +0000 Subject: [PATCH 32/53] Port main functionality of rescue-cd-configurable into rescue-cd.nix as a set of small fixes. Rogue, manual are now ordinary jobs. It is possible to include build dependencies. It is possible to choose one of a few configurations in the boot menu. Of course, configuration overrides may be passed svn path=/nixos/trunk/; revision=15430 --- installer/cd-dvd/rescue-cd.nix | 82 ++++++++++++++-------------------- 1 file changed, 33 insertions(+), 49 deletions(-) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 7a5c97421bc..13b4bcf16b4 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -5,6 +5,13 @@ else "nixos-${builtins.readFile ../../VERSION}" , compressImage ? false , nixpkgs ? ../../../nixpkgs +# This option allows easy building of Rescue CD with +# modified package set / driver set / anything. +# For easier maitenance, let overrider know the current +# options +, configurationOverrides ? (config: {}) +# Whether to put all the build-time dependencies on DVD +, includeBuildDeps ? false }: rec { @@ -13,7 +20,7 @@ rec { cdLabel = "NIXOS_INSTALLATION_CD"; - configuration = { + baseConfiguration = { boot = { isLiveCD = true; @@ -94,6 +101,15 @@ rec { enable = false; }; + showManual = { + enable = true; + manualFile = manual; + }; + + rogue = { + enable = true; + }; + extraJobs = [ # Unpack the NixOS/Nixpkgs sources to /etc/nixos. # !!! run this synchronously @@ -116,50 +132,8 @@ rec { "; } - # Show the NixOS manual on tty7. - { name = "manual"; - job = " - env HOME=/root - 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"; - job = " - env HOME=/root - chdir /root - start on udev - stop on shutdown - respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1 - "; - } ]; - # 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"; - }; - } - /* url is broken - { tty = 8; - theme = pkgs.fetchurl { - url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2; - md5 = "61969309d23c631e57b0a311102ef034"; - }; - } - */ - ]; - }; - mingetty = { helpLine = '' @@ -197,12 +171,12 @@ rec { }; + configuration = baseConfiguration // (configurationOverrides baseConfiguration); system = import ../../system/system.nix { inherit configuration platform nixpkgs; }; - pkgs = system.pkgs; @@ -233,7 +207,7 @@ rec { # The configuration file for Grub. - grubCfg = pkgs.writeText "menu.lst" '' + grubCfg = pkgs.writeText "menu.lst" ('' default 0 timeout 10 splashimage /boot/background.xpm.gz @@ -248,7 +222,14 @@ rec { title Memtest86+ kernel /boot/memtest.bin - ''; + '' + + (pkgs.lib.concatStringsSep "\n\n" + (map (x: '' + title NixOS: ${x.configurationName} + kernel ${x.kernel} systemConfig=${x} init=${x.bootStage2} ${toString system.config.boot.kernelParams} + initrd ${x.initrd} + '') system.children))) + ; # Create an ISO image containing the Grub boot loader, the kernel, @@ -298,7 +279,12 @@ rec { { object = pkgs.stdenv; symlink = "none"; } - ]; + ] + ++ pkgs.lib.optional includeBuildDeps { + object = system.system.drvPath; + symlink = "none"; + } + ; bootable = true; bootImage = "boot/grub/stage2_eltorito"; @@ -307,6 +293,4 @@ rec { volumeID = cdLabel; }; - - } From f7f64961ad8cfe79f000eec5d3332fccc16fbec9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 May 2009 09:09:53 +0000 Subject: [PATCH 33/53] * Make "kde" the default since "gnome" is broken. svn path=/nixos/trunk/; revision=15464 --- system/options.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index 2f96a426638..40f4cb23132 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1262,7 +1262,7 @@ in }; sessionType = mkOption { - default = "gnome"; + default = "kde"; example = "xterm"; description = " The kind of session to start after login. Current possibilies From d2b02686460dd9454c6a23a2cedc654c3240dbb8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 May 2009 12:47:08 +0000 Subject: [PATCH 34/53] * Fixed URL. svn path=/nixos/trunk/; revision=15468 --- system/options.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index 40f4cb23132..35be636fd69 100644 --- a/system/options.nix +++ b/system/options.nix @@ -681,7 +681,7 @@ in /* { tty = 6; theme = pkgs.fetchurl { # Yeah! - url = http://www.bootsplash.de/files/themes/Theme-Pativo.tar.bz2; + url = mirror://gentoo/distfiles/Theme-Pativo.tar.bz2; md5 = "9e13beaaadf88d43a5293e7ab757d569"; }; } From eb32ab1ff2bd21bed8d789e3e2e7eb7d1a8537a5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 May 2009 13:17:14 +0000 Subject: [PATCH 35/53] * Support printing via HTTPS. svn path=/nixos/trunk/; revision=15469 --- upstart-jobs/cupsd.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upstart-jobs/cupsd.nix b/upstart-jobs/cupsd.nix index ced164a1308..cf0f9fad869 100644 --- a/upstart-jobs/cupsd.nix +++ b/upstart-jobs/cupsd.nix @@ -23,6 +23,9 @@ let ln -s ${cups}/lib/cups/backend/* $out/lib/cups/backend/ ln -s ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb + # Provide support for printing via HTTPS. + ln -s ipp $out/lib/cups/backend/https + # Provide Ghostscript rasterisation, necessary for non-Postscript # printers. rm $out/lib/cups/filter From 5af2b1b580392c85799759cb11b897b90575d190 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 7 May 2009 04:24:45 +0000 Subject: [PATCH 36/53] Allow by-label mounting of root on removable device in the drive which does not report media change. svn path=/nixos/trunk/; revision=15480 --- boot/boot-stage-1.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index c37ca27d6b1..070644cadee 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -124,6 +124,7 @@ rec { --replace scsi_id ${extraUtils}/bin/scsi_id \ --replace path_id ${extraUtils}/bin/path_id \ --replace vol_id ${extraUtils}/bin/vol_id + sed -e '/^ENV[{]DEVTYPE[}]=="disk", .*GOTO/d' -i $out/60-persistent-storage.rules ''; # */ }; From 05a7e1368a1f3da9f0c32bd5cf1a02e1898299e5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 May 2009 11:33:22 +0000 Subject: [PATCH 37/53] * grub-menu-builder.sh: with copyKernels = true, don't delete all of /boot/kernels and then copy all the kernels/initrds. Instead, copy only the kernels/initrds that don't exist yet in /boot/kernels, then delete obsolete files in /boot/kernels. Also, use slightly nicer file names in /boot/kernels. svn path=/nixos/trunk/; revision=15505 --- installer/grub-menu-builder.sh | 101 +++++++++++++++++++----------- system/options.nix | 10 +-- system/switch-to-configuration.sh | 6 +- 3 files changed, 71 insertions(+), 46 deletions(-) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 72635c36433..464fc94ce22 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -15,6 +15,9 @@ bootMount="@bootMount@" if test -z "$bootMount"; then bootMount=/boot; fi +echo "updating the Grub menu..." + + target=/boot/grub/menu.lst tmp=$target.tmp @@ -27,14 +30,13 @@ GRUBEND if test -n "@grubSplashImage@"; then splashLocation=@grubSplashImage@ - # !!! image in /nix/store doesn't seem to work - #if test -n "@copyKernels@"; then - cp -f $splashLocation /boot/background.xpm.gz - splashLocation="$bootMount/background.xpm.gz" - #fi + # Splash images in /nix/store don't seem to work, so copy them. + cp -f $splashLocation /boot/background.xpm.gz + splashLocation="$bootMount/background.xpm.gz" echo "splashimage $splashLocation" >> $tmp fi + configurationCounter=0 configurationLimit="@configurationLimit@" numAlienEntries=`cat <-/file to --. +cleanName() { + local path="$1" + echo "$path" | sed 's|^/nix/store/||' | sed 's|/|-|g' +} + + +# Copy a file from the Nix store to /boot/kernels. +declare -A filesCopied + +copyToKernelsDir() { + local src="$1" + local dst="/boot/kernels/$(cleanName $src)" + # Don't copy the file if $dst already exists. This means that we + # have to create $dst atomically to prevent partially copied + # kernels or initrd if this script is ever interrupted. + if ! test -e $dst; then + local dstTmp=$dst.tmp.$$ + cp $src $dstTmp + mv $dstTmp $dst + fi + filesCopied[$dst]=1 + result=$dst +} + + +# Add an entry for a configuration to the Grub menu, and if +# appropriate, copy its kernel and initrd to /boot/kernels. addEntry() { local name="$1" local path="$2" local shortSuffix="$3" configurationCounter=$((configurationCounter + 1)) - if test $configurationCounter -gt @configurationLimit@ ; then - return - fi; + if test $configurationCounter -gt @configurationLimit@; then + return + fi if ! test -e $path/kernel -a -e $path/initrd; then return @@ -63,10 +95,10 @@ addEntry() { local initrd=$(readlink -f $path/initrd) if test "$path" = "$default"; then - cp "$kernel" /boot/nixos-kernel - cp "$initrd" /boot/nixos-initrd - cp "$(readlink -f "$path/init")" /boot/nixos-init - cat > /boot/nixos-grub-config < /boot/nixos-grub-config <> $tmp << GRUBEND @@ -108,11 +131,11 @@ GRUBEND } -rm -rf /boot/kernels if test -n "@copyKernels@"; then mkdir -p /boot/kernels fi + # Additional entries specified verbatim by the configuration. extraGrubEntries=`cat < Date: Sat, 9 May 2009 07:31:56 +0000 Subject: [PATCH 38/53] More correct handling of services tarball svn path=/nixos/trunk/; revision=15508 --- installer/cd-dvd/rescue-cd.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 13b4bcf16b4..ef47d960613 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -5,6 +5,7 @@ else "nixos-${builtins.readFile ../../VERSION}" , compressImage ? false , nixpkgs ? ../../../nixpkgs +, services ? ../../../services # This option allows easy building of Rescue CD with # modified package set / driver set / anything. # For easier maitenance, let overrider know the current @@ -12,6 +13,7 @@ , configurationOverrides ? (config: {}) # Whether to put all the build-time dependencies on DVD , includeBuildDeps ? false +, includeTarballs ? true }: rec { @@ -127,6 +129,8 @@ rec { tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos mkdir -p /etc/nixos/nixpkgs tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos/nixpkgs + mkdir -p /etc/nixos/services + tar xjf /install/services.tar.bz2 -C /etc/nixos/services chown -R root.root /etc/nixos end script "; @@ -202,6 +206,10 @@ rec { nixosTarball = makeTarball "nixos.tar.bz2" ../..; + # Put Services in a tarball. + servicesTarball = makeTarball "services.tar.bz2" services; + + # Put Nixpkgs in a tarball. nixpkgsTarball = makeTarball "nixpkgs.tar.bz2" nixpkgs; @@ -259,12 +267,18 @@ rec { { source = system.config.boot.grubSplashImage; target = "boot/background.xpm.gz"; } + ] + ++ + pkgs.lib.optionals includeTarballs [ { source = nixosTarball + "/" + nixosTarball.tarName; target = "/install/" + nixosTarball.tarName; } { source = nixpkgsTarball + "/nixpkgs.tar.bz2"; target = "/install/nixpkgs.tar.bz2"; } + { source = servicesTarball + "/services.tar.bz2"; + target = "/install/services.tar.bz2"; + } ]; # Closures to be copied to the Nix store on the CD. From 5b368b22bf0f65d14080738cf6f8f44225be1705 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 9 May 2009 07:34:20 +0000 Subject: [PATCH 39/53] An option for times when I only want to init Nix in chroot and build system semi-manually. svn path=/nixos/trunk/; revision=15509 --- installer/nixos-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installer/nixos-install.sh b/installer/nixos-install.sh index 1784b4357f1..b90ffe4145c 100644 --- a/installer/nixos-install.sh +++ b/installer/nixos-install.sh @@ -135,6 +135,10 @@ if test -n "@nixpkgsURL@" -a ${NIXOS_PULL:-1} != 0; then chroot $mountPoint @nix@/bin/nix-pull @nixpkgsURL@/MANIFEST || true fi +if test -n "$NIXOS_PREPARE_CHROOT_ONLY"; then + echo "User requested only to prepare chroot. Exiting." + exit 0; +fi # Build the specified Nix expression in the target store and install # it into the system configuration profile. From 7aa1c2439c2824b0d6cc9f8e010840e220e193cd Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Sat, 9 May 2009 21:00:02 +0000 Subject: [PATCH 40/53] Some kdm fixes svn path=/nixos/trunk/; revision=15519 --- upstart-jobs/kdm.nix | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/upstart-jobs/kdm.nix b/upstart-jobs/kdm.nix index a4bae828c2b..2d93ee2cd55 100644 --- a/upstart-jobs/kdm.nix +++ b/upstart-jobs/kdm.nix @@ -3,7 +3,7 @@ let # Abbreviations. cfg = config.services.xserver; - xorg = pkgs.xlibs; + xorg = cfg.package; inherit (pkgs.lib) optional isInList getAttr; stdenv = pkgs.stdenv; @@ -26,7 +26,7 @@ let resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions); sessionType = cfg.sessionType; - videoDriverModules = getAttr [ videoDriver ] (throw "unkown video driver : \"${videoDriver}\"") knownVideoDrivers; + videoDriverModules = getAttr [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; modules = @@ -90,10 +90,10 @@ let Option "XkbOptions" "${cfg.xkbOptions}" ''; - xkbModel = cfg.xkbModel; - layout = cfg.layout; - - corePointer = if cfg.synaptics.enable then "Touchpad[0]" else "Mouse[0]"; + setCorePointer = + if cfg.synaptics.enable then '' + InputDevice "Touchpad[0]" "CorePointer" + '' else ""; internalAGPGART = if cfg.useInternalAGPGART == "yes" then @@ -181,30 +181,32 @@ let ''; # */ }; + xsession = pkgs.writeText "Xsession" '' source /etc/profile session=$1 - export PATH=$PATH:${pkgs.xterm}/bin:${pkgs.qt4}/bin:${pkgs.dbus.libs}/bin:${pkgs.kde42.kdelibs}/bin:${pkgs.xlibs.xset}/bin:${pkgs.xlibs.xsetroot}/bin:${pkgs.xlibs.xmessage}/bin:${pkgs.xlibs.xprop}/bin + export PATH=$PATH:${pkgs.xterm}/bin:${pkgs.qt4}/bin:${pkgs.dbus.libs}/bin:${pkgs.kde42.kdelibs}/bin:${pkgs.kde42.kdebase_workspace}/bin:${pkgs.xlibs.xset}/bin:${pkgs.xlibs.xsetroot}/bin:${pkgs.xlibs.xmessage}/bin:${pkgs.xlibs.xprop}/bin export XDG_CONFIG_DIRS= export XDG_DATA_DIRS=${pkgs.shared_mime_info}/share + export KDEDIRS=${pkgs.kde42.kdelibs}:${pkgs.kde42.kdebase_workspace} case $session in "") - exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION is no valid session." + xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION is no valid session." ;; failsafe) - exec xterm -geometry 80x24-0-0 + xterm -geometry 80x24-0-0 ;; custom) - exec $HOME/.xsession + $HOME/.xsession ;; default) - exec ${pkgs.kde42.kdebase_workspace}/bin/startkde + startkde ;; *) - eval exec "$session" + eval "$session" ;; esac @@ -231,7 +233,7 @@ let in { name = "kdm"; - + job = '' description "KDE Display Manager" From 018cb283f238a605d1fac7d03caefe4e92eac8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 11 May 2009 11:54:18 +0000 Subject: [PATCH 41/53] Fix `grub-menu-builder.sh'. Previously, since `nullglob' is active, `$(ls /boot/kernels/*)' would translate into `$(ls)' when `/boot/kernels' is empty, which would then lead to the removal of all the files under $PWD. Additionally, if `/boot/kernels' was not empty, `$fn' would contain only the basename of the files, whereas `$filesCopied' is indexed by full paths. svn path=/nixos/trunk/; revision=15548 --- installer/grub-menu-builder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 464fc94ce22..8a99ca5f29d 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -15,7 +15,7 @@ bootMount="@bootMount@" if test -z "$bootMount"; then bootMount=/boot; fi -echo "updating the Grub menu..." +echo "updating the GRUB menu..." target=/boot/grub/menu.lst @@ -176,7 +176,7 @@ mv $tmp $target # Remove obsolete files from /boot/kernels. -for fn in $(ls /boot/kernels/*); do +for fn in /boot/kernels/*; do if ! test "${filesCopied[$fn]}" = 1; then rm -vf -- "$fn" fi From 52889b2323e4dea658006e161d6d95829cca4bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 12 May 2009 17:46:51 +0000 Subject: [PATCH 42/53] Run `fsck' when on AC power. In practice, it should only run once in a while, and should help find inconsistencies or corruptions sooner. See https://mail.cs.uu.nl/pipermail/nix-dev/2009-February/001827.html for a discussion. svn path=/nixos/trunk/; revision=15577 --- boot/boot-stage-1-init.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/boot/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh index b3b2292beaa..524735b1ba2 100644 --- a/boot/boot-stage-1-init.sh +++ b/boot/boot-stage-1-init.sh @@ -166,15 +166,6 @@ checkFS() { # Only check block devices. if ! test -b "$device"; then return 0; fi - # For unclean ext3 file systems, fsck.ext3 should just replay the - # journal and exit, but in practice this takes *much* longer than - # letting the kernel recover the FS. So, don't run fsck on - # journalling file systems. - eval $(fstype "$device") - if test "$FSTYPE" = ext3 -o "$FSTYPE" = ext4 -o "$FSTYPE" = reiserfs -o "$FSTYPE" = xfs -o "$FSTYPE" = jfs; then - return 0; - fi - # Don't run `fsck' if the machine is on battery power. !!! Is # this a good idea? if ! onACPower; then From 60060261a01dee0ec4539625339e25c9141bbcbf Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 13 May 2009 06:10:21 +0000 Subject: [PATCH 43/53] Catch duplicate entries svn path=/nixos/trunk/; revision=15580 --- helpers/make-etc.sh | 10 +++++++++- upstart-jobs/gather.nix | 10 +++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/helpers/make-etc.sh b/helpers/make-etc.sh index a7643b63c5b..4b7bb68be4b 100644 --- a/helpers/make-etc.sh +++ b/helpers/make-etc.sh @@ -7,7 +7,15 @@ targets_=($targets) modes_=($modes) for ((i = 0; i < ${#targets_[@]}; i++)); do ensureDir $out/etc/$(dirname ${targets_[$i]}) - ln -s ${sources_[$i]} $out/etc/${targets_[$i]} + if ! test -e $out/etc/${targets_[$i]}; then + ln -s ${sources_[$i]} $out/etc/${targets_[$i]}; + else + echo Duplicate entry "${targets_[$i]} -> ${sources_[$i]}" + if test "$(readlink "$targets_[$i]")" -ne "$sources_[$i]"; then + echo Mismatched duplicate entry "$(readlink "$targets_[$i]") "'<>'" $sources_[$i]" + exit 1 + fi + fi; if test "${modes_[$i]}" != symlink; then echo "${modes_[$i]}" > $out/etc/${targets_[$i]}.mode fi diff --git a/upstart-jobs/gather.nix b/upstart-jobs/gather.nix index 47193167360..726503f1917 100644 --- a/upstart-jobs/gather.nix +++ b/upstart-jobs/gather.nix @@ -6,8 +6,12 @@ runCommand "upstart-jobs" {inherit jobs;} " ensureDir $out/etc/event.d for i in $jobs; do - if test -d $i; then - ln -s $i/etc/event.d/* $out/etc/event.d/ - fi + if ln -s $i . ; then + if test -d $i; then + ln -s $i/etc/event.d/* $out/etc/event.d/ + fi + else + echo Duplicate entry: $i; + fi; done " From 3f79e158ba5d65a68bc3be964ae91e76f7b07d9e Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 15 May 2009 07:39:36 +0000 Subject: [PATCH 44/53] add missing assertion catching enabled xserver but disabled hal service svn path=/nixos/trunk/; revision=15609 --- upstart-jobs/xserver.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 504a06b8650..775b7524743 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -415,7 +415,8 @@ rec { }; - job = '' + # The X server needs HAL running + job = assert config.services.hal.enable; '' start on ${if cfg.autorun then "hal" else "never"} start script From fa32ac7fb6328e07c86d5b0362db8b3c15f672e2 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 15 May 2009 16:07:27 +0000 Subject: [PATCH 45/53] follow -r15428 and move the comment as well svn path=/nixos/trunk/; revision=15620 --- system/system.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/system.nix b/system/system.nix index 2c60b82f066..35772347462 100644 --- a/system/system.nix +++ b/system/system.nix @@ -379,6 +379,11 @@ rec { grubSplashImage bootMount configurationLimit; }; + # This attribute is responsible for creating boot entries for + # child configuration. They are only (directly) accessible + # when the parent configuration is boot default. For example, + # you can provide an easy way to boot the same configuration + # as you use, but with another kernel children = map (x: ((import ./system.nix) { inherit platform; configuration = x//{boot=((x.boot)//{grubDevice = "";});};}).system) @@ -417,11 +422,6 @@ rec { pkgs.upstart # for initctl ]; upstartInterfaceVersion = pkgs.upstart.interfaceVersion; - # This attribute is responsible for creating boot entries for - # child configuration. They are only (directly) accessible - # when the parent configuration is boot default. For example, - # you can provide an easy way to boot the same configuration - # as you use, but with another kernel }) config.environment.checkConfigurationOptions optionDeclarations config; From 168268ba28918e6e869262c528b69c8c98b64ee6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 May 2009 11:27:20 +0000 Subject: [PATCH 46/53] svn path=/nixos/trunk/; revision=15633 --- system/system.nix | 2 +- upstart-jobs/gw6c.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/system.nix b/system/system.nix index 35772347462..b42ef8b5353 100644 --- a/system/system.nix +++ b/system/system.nix @@ -217,7 +217,7 @@ rec { pkgs.pwdutils pkgs.reiserfsprogs pkgs.rsync - pkgs.seccureUser + pkgs.seccure pkgs.strace pkgs.su pkgs.sysklogd diff --git a/upstart-jobs/gw6c.nix b/upstart-jobs/gw6c.nix index f3332f9e8f3..8f92c5cd090 100644 --- a/upstart-jobs/gw6c.nix +++ b/upstart-jobs/gw6c.nix @@ -5,7 +5,7 @@ let gw6cService = import ../services/gw6c { inherit (pkgs) stdenv gw6c coreutils procps upstart iputils gnused - gnugrep seccureUser writeScript; + gnugrep seccure writeScript; username = cfg.username; password = cfg.password; server = cfg.server; From 88e136954aadd6b61704ee00dbf777c242b0682e Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 19 May 2009 17:08:32 +0000 Subject: [PATCH 47/53] Export all needed PATH elements svn path=/nixos/trunk/; revision=15656 --- upstart-jobs/ejabberd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upstart-jobs/ejabberd.nix b/upstart-jobs/ejabberd.nix index d7ab158af5d..4b924af5dc4 100644 --- a/upstart-jobs/ejabberd.nix +++ b/upstart-jobs/ejabberd.nix @@ -27,7 +27,7 @@ in test -f ${cfg.confDir}/ejabberd.cfg || sed -e 's|{hosts, \["localhost"\]}.|{hosts, \[${cfg.virtualHosts}\]}.|' ${pkgs.ejabberd}/etc/ejabberd/ejabberd.cfg > ${cfg.confDir}/ejabberd.cfg end script - respawn ${pkgs.bash}/bin/sh -c 'export PATH=$PATH:${pkgs.ejabberd}/sbin; cd ~; ejabberdctl --logs ${cfg.logsDir} --spool ${cfg.spoolDir} --config ${cfg.confDir}/ejabberd.cfg start; sleep 1d' + respawn ${pkgs.bash}/bin/sh -c 'export PATH=$PATH:${pkgs.ejabberd}/sbin:${pkgs.coreutils}/bin:${pkgs.bash}/bin; cd ~; ejabberdctl --logs ${cfg.logsDir} --spool ${cfg.spoolDir} --config ${cfg.confDir}/ejabberd.cfg start; sleep 1d' stop script ${pkgs.ejabberd}/sbin/ejabberdctl stop From 393cc8e8b9cdcbf96b0bdbdbd0d5971bdf45fe75 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Tue, 19 May 2009 23:14:45 +0000 Subject: [PATCH 48/53] Substitute the "require" of imported modules by module paths. $ sed -i '/require =/ { :b; s,(import \([^)]*\)),\1,; /];/ { b e }; n; b b; :e }' *.nix svn path=/nixos/trunk/; revision=15660 --- system/options.nix | 20 ++++++++++---------- upstart-jobs/cron.nix | 10 +++++----- upstart-jobs/cron/locate.nix | 2 +- upstart-jobs/dhclient.nix | 2 +- upstart-jobs/fcron.nix | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/system/options.nix b/system/options.nix index 9b038fac903..9fa68009fa5 100644 --- a/system/options.nix +++ b/system/options.nix @@ -3126,19 +3126,19 @@ root ALL=(ALL) SETENV: ALL require = [ # newtworking - (import ../upstart-jobs/dhclient.nix) + ../upstart-jobs/dhclient.nix # hardware - (import ../upstart-jobs/pcmcia.nix) + ../upstart-jobs/pcmcia.nix # services - (import ../upstart-jobs/cron.nix) - (import ../upstart-jobs/fcron.nix) - (import ../upstart-jobs/cron/locate.nix) - (import ../upstart-jobs/manual.nix) - (import ../upstart-jobs/rogue.nix) - (import ../upstart-jobs/guest-users.nix) - (import ../upstart-jobs/pulseaudio.nix) - (import ../upstart-jobs/portmap.nix) + ../upstart-jobs/cron.nix + ../upstart-jobs/fcron.nix + ../upstart-jobs/cron/locate.nix + ../upstart-jobs/manual.nix + ../upstart-jobs/rogue.nix + ../upstart-jobs/guest-users.nix + ../upstart-jobs/pulseaudio.nix + ../upstart-jobs/portmap.nix ]; } diff --git a/upstart-jobs/cron.nix b/upstart-jobs/cron.nix index 078cf4766fc..35c4b488bd7 100644 --- a/upstart-jobs/cron.nix +++ b/upstart-jobs/cron.nix @@ -53,11 +53,11 @@ in { require = [ - # (import ../upstart-jobs/default.nix) # config.services.extraJobs - # (import ?) # config.time.timeZone - # (import ?) # config.environment.etc - # (import ?) # config.environment.extraPackages - # (import ?) # config.environment.cleanStart + # ../upstart-jobs/default.nix # config.services.extraJobs + # ? # config.time.timeZone + # ? # config.environment.etc + # ? # config.environment.extraPackages + # ? # config.environment.cleanStart options ]; diff --git a/upstart-jobs/cron/locate.nix b/upstart-jobs/cron/locate.nix index eace9f5129b..bbb41f6e943 100644 --- a/upstart-jobs/cron/locate.nix +++ b/upstart-jobs/cron/locate.nix @@ -45,7 +45,7 @@ in { require = [ - (import ../../upstart-jobs/cron.nix) # config.services.cron + ../../upstart-jobs/cron.nix # config.services.cron options ]; diff --git a/upstart-jobs/dhclient.nix b/upstart-jobs/dhclient.nix index 5b732f42fd1..342ac57e9b2 100644 --- a/upstart-jobs/dhclient.nix +++ b/upstart-jobs/dhclient.nix @@ -55,7 +55,7 @@ in { require = [ - # (import ../upstart-jobs/default.nix) + # ../upstart-jobs/default.nix options ]; diff --git a/upstart-jobs/fcron.nix b/upstart-jobs/fcron.nix index 5dd61e669d3..b05b9d8ab6a 100644 --- a/upstart-jobs/fcron.nix +++ b/upstart-jobs/fcron.nix @@ -79,11 +79,11 @@ in { require = [ - # (import ../upstart-jobs/default.nix) # config.services.extraJobs - # (import ?) # config.time.timeZone - # (import ?) # config.environment.etc - # (import ?) # config.environment.extraPackages - # (import ?) # config.environment.cleanStart + # ../upstart-jobs/default.nix # config.services.extraJobs + # ? # config.time.timeZone + # ? # config.environment.etc + # ? # config.environment.extraPackages + # ? # config.environment.cleanStart options ]; From 2dbc8d7549b628673324c2bd42d01c19fd3b1eda Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Tue, 19 May 2009 23:25:13 +0000 Subject: [PATCH 49/53] FullDepEntry -> fullDepEntry svn path=/nixos/trunk/; revision=15661 --- system/fontdir.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/fontdir.nix b/system/fontdir.nix index 85227930988..8b8687cd5c9 100644 --- a/system/fontdir.nix +++ b/system/fontdir.nix @@ -5,7 +5,7 @@ args : with args; with builderDefs; buildInputs = [mkfontdir mkfontscale ttmkfdir]; configureFlags = []; fontDirs = import ./fonts.nix {inherit pkgs config;}; - installPhase = FullDepEntry (" + installPhase = fullDepEntry (" list=''; for i in ${toString fontDirs} ; do if [ -d \$i/ ]; then From 0792719b909f1a8f62842a8affb105fcf887c95c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 20 May 2009 10:16:13 +0000 Subject: [PATCH 50/53] * Urgh, forgot to commit. svn path=/nixos/trunk/; revision=15669 --- system/system.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/system.nix b/system/system.nix index b42ef8b5353..d336eb81305 100644 --- a/system/system.nix +++ b/system/system.nix @@ -17,7 +17,7 @@ rec { # values. config = pkgs.lib.fixOptionSets - (pkgs.lib.mergeOptionSets noOption) + pkgs.lib.mergeOptionSets pkgs configComponents; optionDeclarations = From 6b2f1a0ce9605cf77e1b20dc00c1e4e54261551f Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 24 May 2009 10:58:24 +0000 Subject: [PATCH 51/53] lib.getAttr -> lib.attrByPath svn path=/nixos/trunk/; revision=15695 --- upstart-jobs/apache-httpd/default.nix | 2 +- upstart-jobs/default.nix | 8 ++++---- upstart-jobs/kdm.nix | 8 ++++---- upstart-jobs/new-proposal/tightvnc.nix | 2 +- upstart-jobs/xserver.nix | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/upstart-jobs/apache-httpd/default.nix b/upstart-jobs/apache-httpd/default.nix index ee15dc06f01..20eda6ecaac 100644 --- a/upstart-jobs/apache-httpd/default.nix +++ b/upstart-jobs/apache-httpd/default.nix @@ -13,7 +13,7 @@ let getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80; - extraModules = pkgs.lib.getAttr ["extraModules"] [] mainCfg; + extraModules = pkgs.lib.attrByPath ["extraModules"] [] mainCfg; extraForeignModules = pkgs.lib.filter builtins.isAttrs extraModules; extraApachaModules = pkgs.lib.filter (x :! (builtins.isAttrs x)) extraModules; # I'd prefer using builtins.isString here, but doesn't exist yet diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 411fc526d41..2216a564963 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -23,14 +23,14 @@ let newProposalJobs = ( let - inherit (pkgs.lib) getAttr; + inherit (pkgs.lib) attrByPath; inherit (builtins) attrNames pathExists map; - services = getAttr [ "servicesProposal" ] {} config; + services = attrByPath [ "servicesProposal" ] {} config; nameToJobs = name : ( ( let p = ./new-proposal + "/${name}.nix"; p2 = ./new-proposal + "/${name}/default.nix"; - thisConfig = getAttr [ name ] {} services; + thisConfig = attrByPath [ name ] {} services; path = [name]; args = confgiV : { inherit config pkgs thisConfig path; @@ -60,7 +60,7 @@ let then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v else if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}" else abort "unkown option ${errorWhere name}"; - checkConfig = (pkgs.lib.getAttr ["environment" "checkConfigurationOptions"] + checkConfig = (attrByPath ["environment" "checkConfigurationOptions"] optionDeclarations.environment.checkConfigurationOptions.default config); in # TODO: pass path to checker so it can show full path in the abort case diff --git a/upstart-jobs/kdm.nix b/upstart-jobs/kdm.nix index 2d93ee2cd55..ec0e2164b85 100644 --- a/upstart-jobs/kdm.nix +++ b/upstart-jobs/kdm.nix @@ -5,7 +5,7 @@ let cfg = config.services.xserver; xorg = cfg.package; - inherit (pkgs.lib) optional isInList getAttr; + inherit (pkgs.lib) optional isInList attrByPath; stdenv = pkgs.stdenv; knownVideoDrivers = { @@ -26,17 +26,17 @@ let resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions); sessionType = cfg.sessionType; - videoDriverModules = getAttr [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; + videoDriverModules = attrByPath [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; modules = - getAttr ["modulesFirst"] [] videoDriverModules + attrByPath ["modulesFirst"] [] videoDriverModules ++ [ xorg.xorgserver xorg.xf86inputkeyboard xorg.xf86inputmouse ] - ++ getAttr ["modules"] [] videoDriverModules + ++ attrByPath ["modules"] [] videoDriverModules ++ (optional cfg.synaptics.enable ["${pkgs.synaptics}/${xorg.xorgserver}" /*xorg.xf86inputevdev*/]); diff --git a/upstart-jobs/new-proposal/tightvnc.nix b/upstart-jobs/new-proposal/tightvnc.nix index 054828a5230..342910fc886 100644 --- a/upstart-jobs/new-proposal/tightvnc.nix +++ b/upstart-jobs/new-proposal/tightvnc.nix @@ -70,7 +70,7 @@ }; }; - jobs = if (lib.getAttr ["services" "xfs" "enable"] false config) != true + jobs = if (lib.attrByPath ["services" "xfs" "enable"] false config) != true then abort "you need to enable xfs services = { xfs = { enable = true; }; } within your nixos/configuration.nix file" else [ ( rec { diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 775b7524743..105b79ef118 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -6,7 +6,7 @@ let - inherit (pkgs.lib) optional isInList getAttr; + inherit (pkgs.lib) optional isInList attrByPath; # Abbreviations. cfg = config.services.xserver; @@ -32,7 +32,7 @@ let resolutions = map (res: ''"${toString res.x}x${toString res.y}"'') (cfg.resolutions); sessionType = cfg.sessionType; - videoDriverModules = getAttr [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; + videoDriverModules = attrByPath [ videoDriver ] (throw "unknown video driver: `${videoDriver}'") knownVideoDrivers; sessionCmd = @@ -52,12 +52,12 @@ let modules = - getAttr ["modulesFirst"] [] videoDriverModules + attrByPath ["modulesFirst"] [] videoDriverModules ++ [ xorg.xorgserver xorg.xf86inputevdev ] - ++ getAttr ["modules"] [] videoDriverModules + ++ attrByPath ["modules"] [] videoDriverModules ++ (optional cfg.synaptics.enable ["${xorg.xf86inputsynaptics}"]); From dafb4b8c5d52132f25504308e16be753f193e68c Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 24 May 2009 10:58:28 +0000 Subject: [PATCH 52/53] removed all __primops from nixos svn path=/nixos/trunk/; revision=15696 --- upstart-jobs/default.nix | 10 +++++----- upstart-jobs/new-proposal/tightvnc.nix | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 2216a564963..47356114788 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -24,7 +24,7 @@ let ( let inherit (pkgs.lib) attrByPath; - inherit (builtins) attrNames pathExists map; + inherit (builtins) attrNames pathExists map hasAttr getAttr; services = attrByPath [ "servicesProposal" ] {} config; nameToJobs = name : ( ( @@ -54,10 +54,10 @@ let else abort "service ${name} requested but there is no ${p}.nix or ${p}/default.nix file!"; options = (jobFunc (args (abort "you can't use configV within options!"))).options; errorWhere = name : "${name} of service ${builtins.toString path}"; - configV = name : if (__hasAttr name options ) then - let opt = (__getAttr name options ); # this config option description - in if (__hasAttr name thisConfig ) - then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v + configV = name : if (hasAttr name options ) then + let opt = (getAttr name options ); # this config option description + in if (hasAttr name thisConfig ) + then let v = (getAttr name thisConfig); in if opt ? apply then opt.apply v else v else if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}" else abort "unkown option ${errorWhere name}"; checkConfig = (attrByPath ["environment" "checkConfigurationOptions"] diff --git a/upstart-jobs/new-proposal/tightvnc.nix b/upstart-jobs/new-proposal/tightvnc.nix index 342910fc886..b1f8e084810 100644 --- a/upstart-jobs/new-proposal/tightvnc.nix +++ b/upstart-jobs/new-proposal/tightvnc.nix @@ -1,4 +1,6 @@ -{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; rec { +{ path, thisConfig, config, lib, pkgs, upstartHelpers } : with upstartHelpers; +let inherit (builtins) lessThan pathExists attrNames; in +rec { options = { description = "tightvnc vnc server (share virtual desktop over network"; @@ -18,7 +20,7 @@ value must be something between 8 and 32 ''; apply = x: "-depth '${x}'"; - check = x: (__lessThan x 33) && (7 __lessThan x); # not yet used + check = x: (lessThan x 33) && (7 lessThan x); # not yet used }; display = mkOption { default = ":8"; @@ -33,7 +35,7 @@ Can be created using vncpasswd ''; apply = x: "-auth '${x}'"; - check = __pathExists; + check = pathExists; }; httpPort = mkOption { default = "-httpport 5900"; @@ -82,7 +84,7 @@ description \"${name}\" start on network-interfaces/started and xserver/started stop on network-interfaces/stop or xserver/stop -exec ${pkgs.tightvnc}/bin/Xvnc -fp unix/:7100 ${lib.concatStringsSep " " (lib.mapIf (x : x != "description") configV (__attrNames options ) ) } +exec ${pkgs.tightvnc}/bin/Xvnc -fp unix/:7100 ${lib.concatStringsSep " " (lib.mapIf (x : x != "description") configV (attrNames options ) ) } "; } ) ]; } From 575631b72a76307a1bea70c5e0f0a19ad8e929ed Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 24 May 2009 20:28:09 +0000 Subject: [PATCH 53/53] I officially abandon old RescueCD rewrite. I made official version tunable by a small patch.. svn path=/nixos/trunk/; revision=15704 --- installer/cd-dvd/closed-install.nix | 74 --- installer/cd-dvd/live-dvd-X-medium.nix | 213 --------- installer/cd-dvd/live-dvd-X-no-soft.nix | 121 ----- installer/cd-dvd/live-dvd-X.nix | 224 --------- installer/cd-dvd/live-dvd.nix | 72 --- installer/cd-dvd/rescue-cd-closed.nix | 18 - installer/cd-dvd/rescue-cd-configurable.nix | 482 -------------------- installer/cd-dvd/rescue-cd-minimal.nix | 18 - installer/cd-dvd/rescue-cd-offline.nix | 36 -- installer/cd-dvd/rescue-cd-replacement.nix | 32 -- installer/cd-dvd/rescue-dvd.nix | 94 ++++ 11 files changed, 94 insertions(+), 1290 deletions(-) delete mode 100644 installer/cd-dvd/closed-install.nix delete mode 100644 installer/cd-dvd/live-dvd-X-medium.nix delete mode 100644 installer/cd-dvd/live-dvd-X-no-soft.nix delete mode 100644 installer/cd-dvd/live-dvd-X.nix delete mode 100644 installer/cd-dvd/live-dvd.nix delete mode 100644 installer/cd-dvd/rescue-cd-closed.nix delete mode 100644 installer/cd-dvd/rescue-cd-configurable.nix delete mode 100644 installer/cd-dvd/rescue-cd-minimal.nix delete mode 100644 installer/cd-dvd/rescue-cd-offline.nix delete mode 100644 installer/cd-dvd/rescue-cd-replacement.nix create mode 100644 installer/cd-dvd/rescue-dvd.nix diff --git a/installer/cd-dvd/closed-install.nix b/installer/cd-dvd/closed-install.nix deleted file mode 100644 index e7443719f60..00000000000 --- a/installer/cd-dvd/closed-install.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - platform ? __currentSystem - ,hostConnectPort ? "3737" - ,sshPubKey ? /var/certs/ssh/id_livedvd.pub -} : -let - isoFun = import ./rescue-cd-configurable.nix; -in -(isoFun { - inherit platform; - - networkNixpkgs = ""; - manualEnabled = true; - rogueEnabled = false; - sshdEnabled = true; - fontConfigEnabled = false; - sudoEnable = true; - includeMemtest = false; - includeStdenv = true; - includeBuildDeps = true; - - /* - If anyone uses that DVD on live - computer, use DHCP; but also add - a rogue address for tests in virtual - networks without DHCP at all. - */ - addIP = "10.0.253.251"; - netmask = "255.255.0.0"; - - packages = pkgs : [ - pkgs.patch - pkgs.irssi - pkgs.subversion - pkgs.w3m - pkgs.utillinuxCurses - pkgs.wpa_supplicant - pkgs.emacs - pkgs.vimHugeX - pkgs.socat - ]; - - /* - The goal is remotely controlled - installation (maybe over virtual - networking with QEmu without human - interaction), so let's make ssh - work without manual password entry - */ - additionalFiles = [ - { - source = sshPubKey; - target = "/root/.ssh/authorized_keys"; - } - ]; - - additionalJobs = [ - { - name = "Socat-ssh-proxy"; - job = '' - start on sshd/started - script - sleep 5 - /var/run/current-system/sw/bin/socat tcp:10.0.2.2:${hostConnectPort} tcp:127.0.0.1:22 - end script - ''; - } - ]; - nix = pkgs: pkgs.nixCustomFun (pkgs.nixUnstable.src) - "" - ["nix-reduce-build" "nix-http-export.cgi"] - ["--with-docbook-xsl=\\\${pkgs.docbook5_xsl}/xml/xsl/docbook/"]; - extraInitrdKernelModules = ["usb_storage" "ehci_hcd" "ohci_hcd" "iso9660" "ext3"]; -}).rescueCD diff --git a/installer/cd-dvd/live-dvd-X-medium.nix b/installer/cd-dvd/live-dvd-X-medium.nix deleted file mode 100644 index db57921b4c5..00000000000 --- a/installer/cd-dvd/live-dvd-X-medium.nix +++ /dev/null @@ -1,213 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; - xResolutions = [ - { x = 2048; y = 1536; } - { x = 1920; y = 1024; } - { x = 1280; y = 800; } - { x = 1024; y = 768; } - { x = 800; y = 600; } - { x = 640; y = 480; } - ]; - xConfiguration = { - enable = true; - exportConfiguration = true; - tcpEnable = true; - resolutions = xResolutions; - sessionType = "xterm"; - windowManager = "twm"; - tty = "9"; - }; - -in -(isoFun (rec { - inherit platform; - lib = (import ../../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = true; - rogueEnabled = true; - sshdEnabled = true; - fontConfigEnabled = true; - sudoEnable = true; - includeMemtest = true; - includeStdenv = true; - includeBuildDeps = true; - addUsers = ["nixos" "livecd" "livedvd" - "user" "guest" "nix"]; - - extraInitrdKernelModules = - import ./moduleList.nix; - - arbitraryOverrides = config : config // { - services = config.services // { - gw6c = { - enable = true; - autorun = false; - }; - }; - }; - - packages = pkgs : [ - pkgs.irssi - pkgs.ltrace - pkgs.subversion - pkgs.which - pkgs.file - pkgs.zip - pkgs.unzip - pkgs.unrar - pkgs.usbutils - pkgs.bc - pkgs.cpio - pkgs.ncat - pkgs.patch - pkgs.fuse - pkgs.indent - pkgs.zsh - pkgs.hddtemp - pkgs.hdparm - pkgs.sdparm - pkgs.sqlite - pkgs.wpa_supplicant - pkgs.lynx - pkgs.db4 - pkgs.rogue - pkgs.attr - pkgs.acl - pkgs.automake - pkgs.autoconf - pkgs.libtool - pkgs.gnupg - pkgs.openssl - pkgs.gnumake - pkgs.manpages - pkgs.cabextract - pkgs.upstartJobControl - pkgs.fpc - pkgs.perl - pkgs.lftp - pkgs.wget - pkgs.utillinuxCurses - pkgs.iproute - pkgs.diffutils - pkgs.pciutils - pkgs.lsof - pkgs.vimHugeX - pkgs.xpdf - pkgs.ghostscript - pkgs.gv - pkgs.firefoxWrapper - pkgs.xlaunch - pkgs.wirelesstools - pkgs.usbutils - pkgs.dmidecode - pkgs.sshfsFuse - pkgs.ratpoison - pkgs.xorg.twm - pkgs.binutils - pkgs.xorg.lndir - pkgs.pstree - pkgs.psmisc - pkgs.aspell - pkgs.gettext - pkgs.xorg.xorgserver - pkgs.xorg.xsetroot - pkgs.xorg.xhost - pkgs.xorg.xwd - pkgs.xorg.xfontsel - pkgs.xorg.xwud - pkgs.xlaunch - pkgs.xsel - pkgs.xorg.xmessage - pkgs.xorg.xauth - pkgs.keynav - pkgs.xorg.xset - pkgs.xterm - pkgs.xmove - pkgs.xorg.xev - pkgs.xorg.xmodmap - pkgs.xorg.xkbcomp - pkgs.xorg.setxkbmap - pkgs.mssys - pkgs.testdisk - pkgs.gdb - pkgs.pidgin - pkgs.pidginotr - pkgs.gdmap - pkgs.thunderbird - pkgs.wv - pkgs.tightvnc - pkgs.bittornado - pkgs.wireshark - pkgs.smbfsFuse - pkgs.xfsProgs - pkgs.jfsUtils - pkgs.x11vnc - pkgs.lzma - pkgs.dict - pkgs.apacheHttpd - pkgs.xneur - (with pkgs.aspellDicts; [en fr ru]) - (pkgs.dictDBCollector { - dictlist = with pkgs.dictdDBs; map - (x:{ - name = x.dbName; - filename = x.outPath; - locale = x.locale; - }) - [ - eng2fra fra2eng eng2nld - nld2eng eng2rus - mueller_enru_abbr - mueller_enru_base - mueller_enru_dict - mueller_enru_geo - mueller_enru_names - ]; - }) - ]; - - configList = configuration : [ - { - suffix = "X-vesa"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with vesa";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "vesa";}; - }; - }); - } - { - suffix = "X-Intel"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with Intel graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;}; - }; - }); - } - { - suffix = "X-ATI"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with ATI graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;}; - }; - }); - } - { - suffix = "X-NVIDIA"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;}; - }; - }); - } - ]; -})).rescueCD diff --git a/installer/cd-dvd/live-dvd-X-no-soft.nix b/installer/cd-dvd/live-dvd-X-no-soft.nix deleted file mode 100644 index 62ebf683d09..00000000000 --- a/installer/cd-dvd/live-dvd-X-no-soft.nix +++ /dev/null @@ -1,121 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; - xResolutions = [ - { x = 2048; y = 1536; } - { x = 1920; y = 1024; } - { x = 1280; y = 800; } - { x = 1024; y = 768; } - { x = 800; y = 600; } - { x = 640; y = 480; } - ]; - xConfiguration = { - enable = true; - exportConfiguration = true; - tcpEnable = true; - resolutions = xResolutions; - sessionType = "xterm"; - windowManager = "twm"; - tty = "9"; - }; - -in -(isoFun { - inherit platform; - lib = (import ../../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = true; - rogueEnabled = true; - sshdEnabled = true; - fontConfigEnabled = true; - sudoEnable = true; - includeMemtest = true; - includeStdenv = true; - includeBuildDeps = true; - addUsers = ["nixos" "livecd" "livedvd" - "user" "guest" "nix"]; - - extraModulePackages = pkgs: [pkgs.kernelPackages.kqemu]; - extraInitrdKernelModules = - import ./moduleList.nix; - - packages = pkgs : [ - pkgs.which - pkgs.file - pkgs.zip - pkgs.unzip - pkgs.unrar - pkgs.db4 - pkgs.attr - pkgs.acl - pkgs.manpages - pkgs.cabextract - pkgs.upstartJobControl - pkgs.utillinuxCurses - pkgs.emacs - pkgs.lsof - pkgs.vimHugeX - pkgs.firefoxWrapper - pkgs.xlaunch - pkgs.ratpoison - pkgs.xorg.twm - pkgs.xorg.xorgserver - pkgs.xorg.xhost - pkgs.xorg.xfontsel - pkgs.xlaunch - pkgs.xorg.xauth - pkgs.xorg.xset - pkgs.xterm - pkgs.xorg.xev - pkgs.xorg.xmodmap - pkgs.xorg.xkbcomp - pkgs.xorg.setxkbmap - pkgs.mssys - pkgs.testdisk - pkgs.gdb - ]; - - configList = configuration : [ - { - suffix = "X-vesa"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with vesa";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "vesa";}; - }; - }); - } - { - suffix = "X-Intel"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with Intel graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;}; - }; - }); - } - { - suffix = "X-ATI"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with ATI graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;}; - }; - }); - } - { - suffix = "X-NVIDIA"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;}; - }; - }); - } - ]; -}).rescueCD diff --git a/installer/cd-dvd/live-dvd-X.nix b/installer/cd-dvd/live-dvd-X.nix deleted file mode 100644 index c98b398a9af..00000000000 --- a/installer/cd-dvd/live-dvd-X.nix +++ /dev/null @@ -1,224 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; - xResolutions = [ - { x = 2048; y = 1536; } - { x = 1920; y = 1024; } - { x = 1280; y = 800; } - { x = 1024; y = 768; } - { x = 800; y = 600; } - { x = 640; y = 480; } - ]; - xConfiguration = { - enable = true; - exportConfiguration = true; - tcpEnable = true; - resolutions = xResolutions; - sessionType = "xterm"; - windowManager = "twm"; - tty = "9"; - }; - -in -(isoFun (rec { - inherit platform; - lib = (import ../../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = true; - rogueEnabled = true; - sshdEnabled = true; - fontConfigEnabled = true; - sudoEnable = true; - includeMemtest = true; - includeStdenv = true; - includeBuildDeps = true; - addUsers = ["nixos" "livecd" "livedvd" - "user" "guest" "nix"]; - - extraModulePackages = pkgs: [pkgs.kernelPackages.kqemu]; - - extraInitrdKernelModules = - import ./moduleList.nix; - - arbitraryOverrides = config : config // { - services = config.services // { - gw6c = { - enable = true; - autorun = false; - }; - }; - }; - - packages = pkgs : [ - pkgs.irssi - pkgs.ltrace - pkgs.subversion - pkgs.which - pkgs.file - pkgs.zip - pkgs.unzip - pkgs.unrar - pkgs.usbutils - pkgs.bc - pkgs.cpio - pkgs.ncat - pkgs.patch - pkgs.fuse - pkgs.indent - pkgs.zsh - pkgs.hddtemp - pkgs.hdparm - pkgs.sdparm - pkgs.sqlite - pkgs.wpa_supplicant - pkgs.lynx - pkgs.db4 - pkgs.rogue - pkgs.attr - pkgs.acl - pkgs.automake - pkgs.autoconf - pkgs.libtool - pkgs.gnupg - pkgs.openssl - pkgs.units - pkgs.gnumake - pkgs.manpages - pkgs.cabextract - pkgs.upstartJobControl - pkgs.fpc - pkgs.python - pkgs.perl - pkgs.lftp - pkgs.wget - pkgs.guile - pkgs.utillinuxCurses - pkgs.emacs - pkgs.iproute - pkgs.MPlayer - pkgs.diffutils - pkgs.pciutils - pkgs.lsof - pkgs.vimHugeX - pkgs.xpdf - pkgs.ghostscript - pkgs.gv - pkgs.firefoxWrapper - pkgs.xlaunch - pkgs.wirelesstools - pkgs.usbutils - pkgs.dmidecode - pkgs.sdparm - pkgs.hdparm - pkgs.hddtemp - pkgs.sshfsFuse - pkgs.ratpoison - pkgs.xorg.twm - pkgs.binutils - pkgs.xorg.lndir - pkgs.pstree - pkgs.psmisc - pkgs.aspell - pkgs.gettext - pkgs.xorg.xorgserver - pkgs.xorg.xsetroot - pkgs.xorg.xhost - pkgs.xorg.xwd - pkgs.xorg.xfontsel - pkgs.xorg.xwud - pkgs.xlaunch - pkgs.xsel - pkgs.xorg.xmessage - pkgs.xorg.xauth - pkgs.keynav - pkgs.xorg.xset - pkgs.xterm - pkgs.xmove - pkgs.xorg.xev - pkgs.xorg.xmodmap - pkgs.xorg.xkbcomp - pkgs.xorg.setxkbmap - pkgs.mssys - pkgs.testdisk - pkgs.gdb - pkgs.xfsProgs - pkgs.jfsUtils - pkgs.ddrescue - - /* - pkgs.elinks - pkgs.clisp - pkgs.djvulibre - pkgs.imagemagick - */ - - /* - pkgs.pidgin - pkgs.pidginotr - pkgs.gdmap - pkgs.sox - pkgs.timidity - pkgs.xscreensaver - pkgs.thunderbird - pkgs.graphviz - pkgs.tetex - pkgs.pidginlatex - pkgs.openoffice - pkgs.wv - pkgs.maxima - pkgs.jre - pkgs.wine - pkgs.qemu - pkgs.qemuImage - pkgs.wireshark - pkgs.gimp - pkgs.audacity - pkgs.tightvnc - pkgs.bittornado - */ - ]; - - configList = configuration : [ - { - suffix = "X-vesa"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with vesa";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "vesa";}; - }; - }); - } - { - suffix = "X-Intel"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with Intel graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;}; - }; - }); - } - { - suffix = "X-ATI"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with ATI graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;}; - }; - }); - } - { - suffix = "X-NVIDIA"; - configuration = args: ((configuration args) // - { - boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";}; - services = (configuration args).services // { - xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;}; - }; - }); - } - ]; -})).rescueCD diff --git a/installer/cd-dvd/live-dvd.nix b/installer/cd-dvd/live-dvd.nix deleted file mode 100644 index f4bdab1ac4c..00000000000 --- a/installer/cd-dvd/live-dvd.nix +++ /dev/null @@ -1,72 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; -in -(isoFun { - inherit platform; - lib = (import ../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = true; - rogueEnabled = true; - sshdEnabled = true; - fontConfigEnabled = true; - sudoEnable = true; - includeMemtest = true; - includeStdenv = true; - includeBuildDeps = true; - - packages = pkgs : [ - pkgs.irssi - pkgs.elinks - pkgs.ltrace - pkgs.subversion - pkgs.which - pkgs.file - pkgs.zip - pkgs.unzip - pkgs.unrar - pkgs.usbutils - pkgs.bc - pkgs.cpio - pkgs.ncat - pkgs.patch - pkgs.fuse - pkgs.indent - pkgs.zsh - pkgs.hddtemp - pkgs.hdparm - pkgs.sdparm - pkgs.sqlite - pkgs.wpa_supplicant - pkgs.lynx - pkgs.db4 - pkgs.rogue - pkgs.attr - pkgs.acl - pkgs.automake - pkgs.autoconf - pkgs.libtool - pkgs.gnupg - pkgs.openssl - pkgs.units - pkgs.gnumake - pkgs.manpages - pkgs.cabextract - pkgs.upstartJobControl - pkgs.fpc - pkgs.python - pkgs.perl - pkgs.lftp - pkgs.wget - pkgs.guile - pkgs.utillinuxCurses - pkgs.emacs - pkgs.iproute - pkgs.MPlayer - pkgs.diffutils - pkgs.pciutils - pkgs.lsof - pkgs.vimHugeX - ]; -}).rescueCD diff --git a/installer/cd-dvd/rescue-cd-closed.nix b/installer/cd-dvd/rescue-cd-closed.nix deleted file mode 100644 index b6c1df04b63..00000000000 --- a/installer/cd-dvd/rescue-cd-closed.nix +++ /dev/null @@ -1,18 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; -in -(isoFun { - inherit platform; - lib = (import ../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = false; - rogueEnabled = false; - sshdEnabled = false; - fontConfigEnabled = false; - sudoEnable = false; - includeMemtest = false; - includeStdenv = false; - includeBuildDeps = true; -}).rescueCD diff --git a/installer/cd-dvd/rescue-cd-configurable.nix b/installer/cd-dvd/rescue-cd-configurable.nix deleted file mode 100644 index 53524ca36c8..00000000000 --- a/installer/cd-dvd/rescue-cd-configurable.nix +++ /dev/null @@ -1,482 +0,0 @@ -{ - lib ? null - ,platform ? __currentSystem - ,networkNixpkgs ? "" - ,nixpkgsMd5 ? "" - ,manualEnabled ? true - ,rogueEnabled ? true - ,sshdEnabled ? false - ,fontConfigEnabled ? false - ,sudoEnable ? false - ,packages ? (pkgs : []) - ,includeMemtest ? true - ,includeStdenv ? true - ,includeBuildDeps ? false - ,kernelPackages ? (pkgs : pkgs.kernelPackages) - ,extraModulePackages ? (pkgs : []) - ,addUsers ? [] - ,extraInitrdKernelModules ? [] - ,bootKernelModules ? [] - ,arbitraryOverrides ? (config:{}) - ,cleanStart ? false - - /* Should return list of {configuration, suffix} attrsets. - {configuration=configuration; suffix=""} is always prepended. - */ - ,configList ? (configuration : []) - ,aufs ? true - - /* - Address/netmask to be always added, whatever - network-interfaces configure is kept - */ - ,addIP ? "" - ,netmask ? "255.255.255.0" - /* To select interface to bind address to */ - ,ifName ? "eth0" - - /* - list of: {source, target} - */ - ,additionalFiles ? [] - ,compressImage ? false - ,nixpkgsPath ? ../../../nixpkgs - ,additionalJobs ? [] - ,intel3945FWEnable ? true - ,intel4965FWEnable ? true - ,cdLabel ? "NIXOS_INSTALLATION_CD" - ,relName ? - if builtins.pathExists ../../relname - then builtins.readFile ../../relname - else "nixos-${builtins.readFile ../../VERSION}" - ,nix ? pkgs: pkgs.nix -}: -let - realLib = if lib != null then lib else (import (nixpkgsPath+"/pkgs/lib")); -in -let - lib = realLib; - - ttyCount = lib.fold builtins.add 0 [ - (if rogueEnabled then 1 else 0) - (if manualEnabled then 1 else 0) - ]; - - systemPackBuilder = {suffix, configuration} : - { - system = (import ../../system/system.nix) { - inherit configuration platform nixpkgsPath; /* To refactor later - x86+x86_64 DVD */ - }; - inherit suffix configuration; - }; - - systemPackGrubEntry = systemPack : - ('' - - title NixOS Installer / Rescue ${systemPack.system.config.boot.configurationName} - kernel /boot/vmlinuz${systemPack.suffix} ${toString systemPack.system.config.boot.kernelParams} systemConfig=/system${systemPack.suffix} - initrd /boot/initrd${systemPack.suffix} - - ''); - - systemPackInstallRootList = systemPack : - [ - { - source = systemPack.system.kernel + "/vmlinuz"; - target = "boot/vmlinuz${systemPack.suffix}"; - } - { - source = systemPack.system.initialRamdisk + "/initrd"; - target = "boot/initrd${systemPack.suffix}"; - } - ]; - systemPackInstallClosures = systemPack : - ([ - { - object = systemPack.system.bootStage2; - symlink = "/init${systemPack.suffix}"; - } - { - object = systemPack.system.system; - symlink = "/system${systemPack.suffix}"; - } - ] - ++ - (lib.optional includeStdenv - # To speed up the installation, provide the full stdenv. - { - object = systemPack.system.pkgs.stdenv; - symlink = "none"; - } - ) - ); - systemPackInstallBuildClosure = systemPack : - ([ - { - object = systemPack.system.system.drvPath; - symlink = "none"; - } - ]); - - - userEntry = user : - { - name = user; - description = "NixOS Live Disk non-root user"; - home = "/home/${user}"; - createHome = true; - group = "users"; - extraGroups = ["wheel" "audio"]; - shell = "/bin/sh"; - }; -in - -rec { - - inherit cdLabel; - - nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else ""); - - configuration = {pkgs, config, ...}: let preConfiguration ={ - boot = { - isLiveCD = true; - # The label used to identify the installation CD. - extraTTYs = [] - ++ (lib.optional manualEnabled 7) - ++ (lib.optional rogueEnabled 8); - kernelPackages = kernelPackages pkgs; - initrd = { - extraKernelModules = extraInitrdKernelModules - ++ (if aufs then ["aufs"] else []) - ; - }; - kernelModules = bootKernelModules; - extraModulePackages = ((extraModulePackages pkgs) - ++(if aufs then [(kernelPackages pkgs).aufs] else []) - ); - }; - - services = { - - sshd = { enable = sshdEnabled; }; - - xserver = { enable = false; }; - - udev = { - addFirmware = [] - #++ (pkgs.lib.optional intel3945FWEnable pkgs.iwlwifi3945ucode) - #++ (pkgs.lib.optional intel4965FWEnable pkgs.iwlwifi4965ucode) - ; - }; - - extraJobs = [ - # Unpack the NixOS/Nixpkgs sources to /etc/nixos. - { - name = "unpack-sources"; - job = '' - start on startup - script - export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH - - mkdir -p /mnt - - ${system.nix}/bin/nix-store --load-db < /nix-path-registration - - mkdir -p /etc/nixos/nixos - tar xjf /install/nixos.tar.bz2 -C /etc/nixos/nixos - tar xjf /install/nixpkgs.tar.bz2 -C /etc/nixos - tar xjf /install/nixos-services.tar.bz2 -C /etc/nixos - mv /etc/nixos/nixpkgs-* /etc/nixos/nixpkgs || true - mv /etc/nixos/*-nixpkgs /etc/nixos/nixpkgs || true - mv /etc/nixos/*-services /etc/nixos/services || true - ln -sfn ../nixpkgs/pkgs /etc/nixos/nixos/pkgs - ln -sfn ../services /etc/nixos/services - chown -R root.root /etc/nixos - touch /etc/resolv.conf - end script - ''; - } - ] - - ++ additionalJobs - - ++ - - (lib.optional manualEnabled - # 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 - ''; - } - ) - - ++ - - (lib.optional rogueEnabled - # Allow the user to do something useful on tty8 while waiting - # for the installation to finish. - { - name = "rogue"; - job = '' - start on udev - stop on shutdown - respawn ${pkgs.rogue}/bin/rogue < /dev/tty8 > /dev/tty8 2>&1 - ''; - } - ) - - ++ - - (lib.optional (addUsers != []) - # Set empty passwords - { - name = "clear-passwords"; - job = '' - start on startup - script - for i in ${lib.concatStringsSep " " addUsers}; do - echo | ${pkgs.pwdutils}/bin/passwd --stdin $i - done - end script - ''; - } - ) - - ++ - - (lib.optional (addIP != "") - { - name = "add-IP-adress"; - job = '' - start on network-interfaces/started - script - ${pkgs.nettools}/sbin/ifconfig ${ifName} add ${addIP} up - ${pkgs.nettools}/sbin/ifconfig ${ifName}:0 netmask ${netmask} up - end script - ''; - } - ) - ; - - # And a background to go with that. - ttyBackgrounds = { - specificThemes = [] - ++ - (lib.optional manualEnabled - { - 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"; - }; - } - ) - ++ - (lib.optional rogueEnabled - { - tty = 8; - theme = pkgs.fetchurl { - url = http://www.bootsplash.de/files/themes/Theme-GNU.tar.bz2; - md5 = "61969309d23c631e57b0a311102ef034"; - }; - } - ) - ; - }; - - mingetty = { - helpLine = '' - Log in as "root" with an empty password. - '' - +(if addUsers != [] then - '' These users also have empty passwords: - ${lib.concatStringsSep " " addUsers } - '' - else "") - +(if manualEnabled then " Press for help." else ""); - }; - - }; - - fonts = { enableFontConfig = fontConfigEnabled; }; - - installer = { - nixpkgsURL = - (if networkNixpkgs != "" then http://nix.cs.uu.nl/dist/nix/ + nixpkgsRel - else file:///mnt/ ); - }; - - security = { - sudo = { enable = sudoEnable; }; - }; - - environment = { - extraPackages = if cleanStart then [] else [ - pkgs.vim - pkgs.subversion # for nixos-checkout - pkgs.w3m # needed for the manual anyway - ] ++ (packages pkgs); - checkConfigurationOptions = true; - cleanStart = cleanStart; - nix = nix pkgs; - }; - - users = { - extraUsers = map userEntry addUsers; - }; - - fileSystems = [ - { mountPoint = "/"; - label = cdLabel; - } - ]; - - }; in preConfiguration // (arbitraryOverrides preConfiguration); - - configurations = [{ - inherit configuration; - suffix = ""; - }] ++ (configList configuration); - systemPacks = map systemPackBuilder configurations; - - system = (builtins.head systemPacks).system; /* I hope this is unneeded */ - pkgs = system.pkgs; /* Nothing non-fixed should be built from it */ - - - # 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 {inherit nixpkgsPath;}}/manual.html" - else pkgs.writeText "dummy-manual" "Manual not included in this build!"; - - - # We need a copy of the Nix expressions for Nixpkgs and NixOS on the - # CD. We put them in a tarball because accessing that many small - # files from a slow device like a CD-ROM takes too long. - makeTarball = tarName: input: pkgs.runCommand "tarball" {inherit tarName;} '' - ensureDir $out - (cd ${input} && tar cvfj $out/${tarName} . \ - --exclude '*~' \ - --exclude 'pkgs' --exclude 'result') - ''; - - makeNixPkgsTarball = tarName: input: ((pkgs.runCommand "tarball-nixpkgs" {inherit tarName;} '' - ensureDir $out - (cd ${input}/.. && tar cvfj $out/${tarName} $(basename ${input}) \ - --exclude '*~' \ - --exclude 'result') - '')+"/${tarName}"); - - - - # Put the current directory in a tarball (making sure to filter - # out crap like the .svn directories). - nixosTarball = - let filter = name: type: - let base = baseNameOf (toString name); - in base != ".svn" && base != "result"; - in - makeTarball "nixos.tar.bz2" (builtins.filterSource filter ./../..); - - - # Get a recent copy of Nixpkgs. - nixpkgsTarball = if networkNixpkgs != "" then pkgs.fetchurl { - url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2"; - md5 = "6a793b877e2a4fa79827515902e1dfd8"; - } else makeNixPkgsTarball "nixpkgs.tar.bz2" ("" + nixpkgsPath); - - nixosServicesTarball = makeNixPkgsTarball "nixos-services.tar.bz2" ("" + ./../../../services); - - # The configuration file for Grub. - grubCfg = pkgs.writeText "menu.lst" ('' - default 0 - timeout 10 - splashimage /boot/background.xpm.gz - ''+ - (lib.concatStrings (map systemPackGrubEntry systemPacks)) - + (if includeMemtest then - '' - - title Memtest86+ - kernel /boot/memtest.bin - '' else "")); - - - # 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 cdrkit; - inherit compressImage nixpkgsPath; - isoName = "nixos-${relName}-${platform}.iso"; - - # Single files to be copied to fixed locations on the CD. - contents = lib.uniqList { - inputList = [ - { - source = - "${pkgs.grub}/lib/grub/${if platform == "i686-linux" then "i386-pc" else "x86_64-unknown"}/stage2_eltorito"; - target = "boot/grub/stage2_eltorito"; - } - { - source = grubCfg; - target = "boot/grub/menu.lst"; - } - ] - ++ - (lib.concatLists (map systemPackInstallRootList systemPacks)) - ++ - [ - { - source = system.config.boot.grubSplashImage; - target = "boot/background.xpm.gz"; - } - { - source = nixosTarball + "/" + nixosTarball.tarName; - target = "/install/" + nixosTarball.tarName; - } - { - source = nixpkgsTarball; - target = "/install/nixpkgs.tar.bz2"; - } - { - source = nixosServicesTarball; - target = "/install/nixos-services.tar.bz2"; - } - ] - ++ - (lib.optional includeMemtest - { - source = pkgs.memtest86 + "/memtest.bin"; - target = "boot/memtest.bin"; - } - ) - ++ - additionalFiles - ; - }; - - # Closures to be copied to the Nix store on the CD. - storeContents = - lib.uniqListExt { - inputList = lib.concatLists - (map systemPackInstallClosures systemPacks); - getter = x: x.object.drvPath; - compare = lib.eqStrings; - } - ++ lib.uniqList { - inputList = lib.optionals includeBuildDeps - (lib.concatLists (map systemPackInstallBuildClosure systemPacks)); - }; - - bootable = true; - bootImage = "boot/grub/stage2_eltorito"; - - volumeID = cdLabel; - }; - -} diff --git a/installer/cd-dvd/rescue-cd-minimal.nix b/installer/cd-dvd/rescue-cd-minimal.nix deleted file mode 100644 index c96e651cb53..00000000000 --- a/installer/cd-dvd/rescue-cd-minimal.nix +++ /dev/null @@ -1,18 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; -in -(isoFun { - inherit platform; - lib = (import ../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = false; - rogueEnabled = false; - sshdEnabled = false; - fontConfigEnabled = false; - sudoEnable = false; - includeMemtest = false; - includeStdenv = false; - includeBuildDeps = false; -}).rescueCD diff --git a/installer/cd-dvd/rescue-cd-offline.nix b/installer/cd-dvd/rescue-cd-offline.nix deleted file mode 100644 index ab650f65938..00000000000 --- a/installer/cd-dvd/rescue-cd-offline.nix +++ /dev/null @@ -1,36 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; -in -(isoFun { - inherit platform; - lib = (import ../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = false; - rogueEnabled = false; - sshdEnabled = false; - fontConfigEnabled = false; - sudoEnable = false; - includeMemtest = false; - includeStdenv = false; - includeBuildDeps = true; - cleanStart = true; - packages = pkgs: with pkgs; [ - bashInteractive - bzip2 - coreutils - curl - e2fsprogs - gnutar - grub - gzip - less - module_init_tools - nano - su - udev - upstart - utillinux - ]; -}).rescueCD diff --git a/installer/cd-dvd/rescue-cd-replacement.nix b/installer/cd-dvd/rescue-cd-replacement.nix deleted file mode 100644 index d40e23221ef..00000000000 --- a/installer/cd-dvd/rescue-cd-replacement.nix +++ /dev/null @@ -1,32 +0,0 @@ -{platform ? __currentSystem} : -let - isoFun = import ./rescue-cd-configurable.nix; -in (isoFun { - inherit platform; - lib = (import ../pkgs/lib); - - networkNixpkgs = ""; - manualEnabled = false; - rogueEnabled = false; - sshdEnabled = false; - fontConfigEnabled = false; - sudoEnable = false; - includeMemtest = false; - includeStdenv = false; - includeBuildDeps = false; - - extraInitrdKernelModules = - import ./moduleList.nix; - packages = pkgs: [ - pkgs.vim - pkgs.subversion # for nixos-checkout - pkgs.w3m # needed for the manual anyway - pkgs.gdb # for debugging Nix - pkgs.testdisk # useful for repairing boot problems - pkgs.mssys # for writing Microsoft boot sectors / MBRs - pkgs.xfsProgs - pkgs.jfsUtils - pkgs.ddrescue - ]; - -}).rescueCD diff --git a/installer/cd-dvd/rescue-dvd.nix b/installer/cd-dvd/rescue-dvd.nix new file mode 100644 index 00000000000..8d0b62ce447 --- /dev/null +++ b/installer/cd-dvd/rescue-dvd.nix @@ -0,0 +1,94 @@ +let + rescueCDFun = import /etc/nixos/nixos/installer/cd-dvd/rescue-cd.nix; + pkgs = import /etc/nixos/nixpkgs {}; + kernels = import /etc/nixos/configurations/misc/raskin/kernel-options.nix {inherit pkgs;}; + bootEntries = baseKernel: rec { + kernelPackages = let + shippedKernelPackages = pkgs.kernelPackagesFor (baseKernel); + in + shippedKernelPackages // + rec { + klibc = shippedKernelPackages.klibc.passthru.function (x: { + # version = "1.5.14"; + # sha256 = "1cmrqpgamnv2ns7dlxjm61zc88dxm4ff0aya413ij1lmhp2h2sfc"; + # subdir = "Testing/"; + addPreBuild = '' + ln -s $PWD/linux/include/*/errno.h linux/include/asm || echo errno.h already present + ''; + }); + + klibcShrunk = shippedKernelPackages.klibcShrunk.passthru.function { + inherit klibc; + }; + }; + + }; +in + +rescueCDFun { + includeBuildDeps = true; + configurationOverrides = x: { + boot = x.boot // { + kernelPackages = (bootEntries kernels.testingKernel).kernelPackages; + initrd = x.boot.initrd // { + extraKernelModules = x.boot.initrd.extraKernelModules ++ [ + "sr_mod" "atiixp" + ]; + allowMissing = true; + }; + }; + environment = { + extraPackages = x.environment.extraPackages ++ [ + pkgs.utillinuxCurses pkgs.wpa_supplicant + pkgs.upstartJobControl pkgs.iproute + pkgs.bc pkgs.fuse pkgs.zsh + pkgs.sqlite pkgs.gnupg pkgs.manpages + pkgs.pinentry pkgs.screen + + pkgs.patch pkgs.which pkgs.diffutils pkgs.file + + pkgs.irssi pkgs.mcabber pkgs.mutt + + pkgs.emacs pkgs.vimHugeX pkgs.bvi + + pkgs.ddrescue pkgs.cdrkit + + pkgs.btrfsProgs pkgs.xfsProgs pkgs.jfsUtils + pkgs.jfsrec pkgs.ntfs3g + + pkgs.subversion16 pkgs.monotone pkgs.git pkgs.darcs + pkgs.mercurial pkgs.bazaar pkgs.cvs + + pkgs.pciutils pkgs.hddtemp pkgs.sdparm pkgs.hdparm + pkgs.usbutils + + pkgs.openssh pkgs.lftp pkgs.w3m pkgs.openssl pkgs.ncat + pkgs.lynx pkgs.wget pkgs.elinks pkgs.socat pkgs.squid + + pkgs.unrar pkgs.zip pkgs.unzip pkgs.lzma pkgs.cabextract + pkgs.cpio + + pkgs.lsof pkgs.ltrace + + pkgs.perl pkgs.python pkgs.ruby pkgs.guile pkgs.clisp + pkgs.tcl + ]; + + nix = pkgs.nixCustomFun ("" + /etc/nixos/nix + "/") + "" + ["nix-reduce-build" "nix-http-export.cgi"] + ["--with-docbook-xsl=${pkgs.docbook5_xsl}/xml/xsl/docbook/"]; + }; + +# nesting = { +# children = [ +# (x // { +# boot = x.boot // { +# kernelPackages = (bootEntries kernels.testingKernel).kernelPackages; +# configurationName = "Test child configuration"; +# }; +# }) +# ]; +# }; + }; +}