From eb6e1310b8774f3aed4c5675d09708f0df6199d3 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 14 Sep 2011 18:20:50 +0000 Subject: [PATCH] strip trailing whitespace; no functional change svn path=/nixos/trunk/; revision=29285 --- default.nix | 4 +- doc/config-examples/basic.nix | 2 +- .../closed-install-configuration.nix | 6 +- doc/config-examples/svn-server.nix | 10 +- doc/manual/default.nix | 6 +- lib/build-vms.nix | 14 +-- lib/make-iso9660-image.nix | 4 +- lib/make-squashfs.nix | 6 +- lib/make-system-tarball.nix | 4 +- lib/testing.nix | 34 +++--- maintainers/option-usages.nix | 2 +- modules/config/fonts.nix | 10 +- modules/config/krb5.nix | 2 +- modules/config/ldap.nix | 2 +- modules/config/networking.nix | 2 +- modules/config/power-management.nix | 16 +-- modules/config/pulseaudio.nix | 14 +-- modules/config/shells.nix | 2 +- modules/config/swap.nix | 8 +- modules/config/system-path.nix | 8 +- modules/config/unix-odbc-drivers.nix | 6 +- modules/config/users-groups.nix | 14 +-- modules/hardware/network/intel-2100bg.nix | 8 +- modules/hardware/network/intel-2200bg.nix | 8 +- modules/hardware/network/intel-3945abg.nix | 8 +- modules/hardware/network/rt73.nix | 6 +- modules/hardware/network/rtl8192c.nix | 6 +- modules/hardware/video/encoder/wis-go7007.nix | 2 +- .../installer/cd-dvd/installation-cd-base.nix | 6 +- modules/installer/cd-dvd/iso-image.nix | 18 +-- modules/installer/cd-dvd/live-dvd.nix | 20 ++-- .../cd-dvd/system-tarball-fuloong2f.nix | 8 +- .../installer/cd-dvd/system-tarball-pc.nix | 12 +- .../cd-dvd/system-tarball-sheevaplug.nix | 6 +- modules/installer/cd-dvd/system-tarball.nix | 2 +- modules/installer/grub/grub.nix | 10 +- modules/installer/init-script/init-script.nix | 8 +- modules/installer/tools/nixos-checkout.nix | 2 +- .../tools/nixos-deploy-network/deploy.nix | 46 ++++---- modules/misc/assertions.nix | 4 +- modules/misc/deployment.nix | 14 +-- modules/misc/ids.nix | 4 +- modules/misc/locate.nix | 2 +- modules/misc/nixpkgs.nix | 2 +- modules/misc/passthru.nix | 6 +- modules/profiles/installation-device.nix | 2 +- modules/profiles/rescue.nix | 10 +- modules/programs/bash/bash.nix | 8 +- modules/programs/info.nix | 2 +- modules/programs/shadow.nix | 18 +-- modules/security/ca.nix | 2 +- modules/security/consolekit.nix | 2 +- modules/security/policykit.nix | 6 +- modules/security/polkit.nix | 8 +- modules/security/rtkit.nix | 4 +- modules/security/setuid-wrappers.nix | 6 +- modules/security/sudo.nix | 2 +- modules/services/amqp/rabbitmq.nix | 6 +- modules/services/audio/alsa.nix | 14 +-- modules/services/audio/pulseaudio.nix | 10 +- modules/services/backup/mysql-backup.nix | 12 +- modules/services/backup/postgresql-backup.nix | 10 +- modules/services/backup/sitecopy-backup.nix | 20 ++-- .../services/databases/4store-endpoint.nix | 6 +- modules/services/databases/4store.nix | 6 +- modules/services/databases/mysql.nix | 48 ++++---- modules/services/databases/openldap.nix | 6 +- modules/services/databases/postgresql.nix | 30 ++--- modules/services/databases/virtuoso.nix | 6 +- modules/services/games/ghost-one.nix | 6 +- modules/services/hardware/acpid.nix | 24 ++-- modules/services/hardware/bluetooth.nix | 10 +- modules/services/hardware/hal.nix | 16 +-- modules/services/hardware/pcscd.nix | 12 +- modules/services/hardware/udev.nix | 24 ++-- modules/services/hardware/udisks.nix | 10 +- modules/services/hardware/upower.nix | 10 +- modules/services/logging/klogd.nix | 2 +- modules/services/mail/dovecot.nix | 30 ++--- modules/services/mail/freepops.nix | 2 +- modules/services/mail/mail.nix | 4 +- modules/services/mail/postfix.nix | 92 ++++++++-------- modules/services/misc/autofs.nix | 10 +- modules/services/misc/disnix.nix | 36 +++--- modules/services/misc/felix.nix | 32 +++--- modules/services/misc/folding-at-home.nix | 8 +- modules/services/misc/gpsd.nix | 10 +- modules/services/misc/nix-daemon.nix | 28 ++--- modules/services/misc/nixos-manual.nix | 8 +- modules/services/misc/rogue.nix | 10 +- modules/services/misc/svnserve.nix | 18 +-- modules/services/misc/synergy.nix | 18 +-- modules/services/misc/virtualbox.nix | 16 +-- modules/services/monitoring/monit.nix | 10 +- .../services/monitoring/nagios/default.nix | 10 +- modules/services/monitoring/systemhealth.nix | 2 +- modules/services/monitoring/ups.nix | 4 +- modules/services/monitoring/zabbix-agent.nix | 10 +- modules/services/monitoring/zabbix-server.nix | 8 +- .../network-filesystems/nfs-kernel.nix | 26 ++--- .../services/network-filesystems/samba.nix | 12 +- modules/services/networking/amuled.nix | 6 +- modules/services/networking/avahi-daemon.nix | 8 +- modules/services/networking/bind.nix | 22 ++-- modules/services/networking/bitlbee.nix | 12 +- modules/services/networking/ddclient.nix | 8 +- modules/services/networking/dhclient.nix | 20 ++-- modules/services/networking/dnsmasq.nix | 10 +- modules/services/networking/firewall.nix | 24 ++-- modules/services/networking/git-daemon.nix | 6 +- modules/services/networking/gnunet.nix | 4 +- modules/services/networking/gvpe.nix | 24 ++-- modules/services/networking/gw6c/default.nix | 20 ++-- modules/services/networking/ifplugd.nix | 8 +- .../networking/ircd-hybrid/default.nix | 12 +- modules/services/networking/nat.nix | 10 +- modules/services/networking/ntpd.nix | 10 +- modules/services/networking/openfire.nix | 16 +-- modules/services/networking/openvpn.nix | 12 +- modules/services/networking/portmap.nix | 8 +- modules/services/networking/privoxy.nix | 8 +- modules/services/networking/quassel.nix | 8 +- modules/services/networking/radvd.nix | 12 +- modules/services/networking/rdnssd.nix | 6 +- modules/services/networking/sabnzbd.nix | 4 +- modules/services/networking/ssh/lshd.nix | 10 +- modules/services/networking/tftpd.nix | 2 +- modules/services/networking/vsftpd.nix | 14 +-- modules/services/networking/wakeonlan.nix | 4 +- modules/services/networking/wicd.nix | 8 +- modules/services/networking/xinetd.nix | 18 +-- modules/services/printing/cupsd.nix | 2 +- modules/services/scheduling/atd.nix | 10 +- modules/services/scheduling/cron.nix | 10 +- modules/services/scheduling/fcron.nix | 18 +-- modules/services/security/tor.nix | 42 +++---- modules/services/security/torsocks.nix | 4 +- modules/services/system/dbus.nix | 16 +-- modules/services/system/kerberos.nix | 10 +- modules/services/system/nscd.nix | 6 +- modules/services/system/uptimed.nix | 12 +- modules/services/ttys/gpm.nix | 14 +-- modules/services/ttys/mingetty.nix | 16 +-- .../web-servers/apache-httpd/default.nix | 44 ++++---- .../web-servers/apache-httpd/mediawiki.nix | 24 ++-- .../web-servers/apache-httpd/mercurial.nix | 20 ++-- .../apache-httpd/per-server-options.nix | 4 +- .../apache-httpd/tomcat-connector.nix | 8 +- .../web-servers/apache-httpd/trac.nix | 22 ++-- .../web-servers/apache-httpd/zabbix.nix | 4 +- .../services/web-servers/jboss/default.nix | 10 +- modules/services/web-servers/tomcat.nix | 104 +++++++++--------- .../services/x11/desktop-managers/default.nix | 6 +- .../services/x11/desktop-managers/kde4.nix | 4 +- .../services/x11/desktop-managers/xfce.nix | 8 +- .../services/x11/desktop-managers/xterm.nix | 2 +- .../services/x11/display-managers/auto.nix | 6 +- .../services/x11/display-managers/default.nix | 14 +-- modules/services/x11/display-managers/kdm.nix | 22 ++-- .../services/x11/display-managers/slim.nix | 4 +- modules/services/x11/hardware/multitouch.nix | 2 +- modules/services/x11/hardware/synaptics.nix | 4 +- .../services/x11/window-managers/awesome.nix | 4 +- .../services/x11/window-managers/compiz.nix | 10 +- .../services/x11/window-managers/icewm.nix | 4 +- modules/services/x11/window-managers/twm.nix | 4 +- modules/services/x11/xfs.nix | 10 +- modules/services/x11/xserver.nix | 26 ++--- .../system/activation/activation-script.nix | 28 ++--- modules/system/activation/top-level.nix | 22 ++-- modules/system/boot/luksroot.nix | 4 +- modules/system/boot/modprobe.nix | 10 +- modules/system/upstart-events/shutdown.nix | 14 +-- modules/system/upstart/upstart.nix | 34 +++--- modules/tasks/filesystems.nix | 18 +-- modules/tasks/kbd.nix | 14 +-- modules/tasks/lvm.nix | 2 +- modules/tasks/network-interfaces.nix | 24 ++-- modules/tasks/swraid.nix | 4 +- modules/tasks/tty-backgrounds.nix | 22 ++-- modules/testing/test-instrumentation.nix | 12 +- modules/virtualisation/amazon-image.nix | 10 +- modules/virtualisation/libvirtd.nix | 16 +-- modules/virtualisation/nova-image.nix | 10 +- modules/virtualisation/nova.nix | 10 +- modules/virtualisation/qemu-vm.nix | 46 ++++---- modules/virtualisation/xen-dom0.nix | 26 ++--- modules/virtualisation/xen-domU.nix | 2 +- release.nix | 18 +-- tests/bittorrent.nix | 12 +- tests/check-filesystems.nix | 6 +- tests/firefox.nix | 4 +- tests/firewall.nix | 4 +- tests/installer.nix | 42 +++---- tests/ipv6.nix | 16 +-- tests/kde4.nix | 6 +- tests/login.nix | 6 +- tests/mysql-replication.nix | 18 +-- tests/mysql.nix | 10 +- tests/nat.nix | 12 +- tests/nfs.nix | 10 +- tests/openssh.nix | 22 ++-- tests/proxy.nix | 2 +- tests/quake3.nix | 8 +- tests/remote-builds.nix | 2 +- tests/subversion.nix | 10 +- tests/tomcat.nix | 8 +- tests/trac.nix | 28 ++--- tests/xfce.nix | 10 +- 209 files changed, 1296 insertions(+), 1296 deletions(-) diff --git a/default.nix b/default.nix index 6b929537ee4..6c0934724c7 100644 --- a/default.nix +++ b/default.nix @@ -3,7 +3,7 @@ }: let - + eval = import ./lib/eval-config.nix { inherit system; modules = [ configuration ]; @@ -26,7 +26,7 @@ let { virtualisation.useBootLoader = true; } ]; }).config; - + in { diff --git a/doc/config-examples/basic.nix b/doc/config-examples/basic.nix index 976630d0607..da37cfb8c28 100644 --- a/doc/config-examples/basic.nix +++ b/doc/config-examples/basic.nix @@ -12,7 +12,7 @@ swapDevices = [ { device = "/dev/sdb1"; } ]; - + services = { openssh = { enable = true; diff --git a/doc/config-examples/closed-install-configuration.nix b/doc/config-examples/closed-install-configuration.nix index 807bf73d0e6..fed557ddd0d 100644 --- a/doc/config-examples/closed-install-configuration.nix +++ b/doc/config-examples/closed-install-configuration.nix @@ -18,15 +18,15 @@ swapDevices = [ { device = "/dev/sda2"; } ]; - + services = { sshd = { enable = true; }; }; - fonts = { - enableFontConfig = false; + fonts = { + enableFontConfig = false; }; } diff --git a/doc/config-examples/svn-server.nix b/doc/config-examples/svn-server.nix index 7f2dafe16ad..68a3374987f 100644 --- a/doc/config-examples/svn-server.nix +++ b/doc/config-examples/svn-server.nix @@ -2,7 +2,7 @@ boot = { grubDevice = "/dev/sda"; }; - + fileSystems = [ { mountPoint = "/"; device = "/dev/sda1"; @@ -10,7 +10,7 @@ ]; services = { - + sshd = { enable = true; }; @@ -28,9 +28,9 @@ }; }; - + }; - + }; - + } diff --git a/doc/manual/default.nix b/doc/manual/default.nix index 53b7ec2d783..c82a46b0537 100644 --- a/doc/manual/default.nix +++ b/doc/manual/default.nix @@ -3,7 +3,7 @@ , revision ? "HEAD" }: -let +let # To prevent infinite recursion, remove system.path from the # options. Not sure why this happens. @@ -59,7 +59,7 @@ in rec { ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/ cp ${./style.css} $dst/style.css - + ensureDir $out/nix-support echo "doc manual $dst manual.html" >> $out/nix-support/hydra-build-products ''; @@ -93,4 +93,4 @@ in rec { ''; }; -} \ No newline at end of file +} diff --git a/lib/build-vms.nix b/lib/build-vms.nix index f151060344e..87ca2a711d1 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -9,7 +9,7 @@ rec { inherit pkgs; - + # Build a virtual network from an attribute set `{ machine1 = # config1; ... machineN = configN; }', where `machineX' is the # hostname and `configX' is a NixOS system configuration. Each @@ -38,7 +38,7 @@ rec { assignIPAddresses = nodes: let - + machines = lib.attrNames nodes; machinesNumbered = lib.zipTwoLists machines (lib.range 1 254); @@ -47,7 +47,7 @@ rec { [ ( { config, pkgs, nodes, ... }: let interfacesNumbered = lib.zipTwoLists config.virtualisation.vlans (lib.range 1 255); - interfaces = + interfaces = lib.flip map interfacesNumbered ({ first, second }: { name = "eth${toString second}"; ipAddress = "192.168.${toString first}.${toString m.second}"; @@ -58,12 +58,12 @@ rec { { key = "ip-address"; config = { networking.hostName = m.first; - + networking.interfaces = interfaces; - + networking.primaryIPAddress = lib.optionalString (interfaces != []) (lib.head interfaces).ipAddress; - + # Put the IP addresses of all VMs in this machine's # /etc/hosts file. If a machine has multiple # interfaces, use the IP address corresponding to @@ -74,7 +74,7 @@ rec { lib.optionalString (config.networking.primaryIPAddress != "") ("${config.networking.primaryIPAddress} " + "${config.networking.hostName}\n")); - + virtualisation.qemu.options = lib.flip map interfacesNumbered ({ first, second }: qemuNICFlags second first m.second); diff --git a/lib/make-iso9660-image.nix b/lib/make-iso9660-image.nix index 51dce5eb402..9dfde3e4a7c 100644 --- a/lib/make-iso9660-image.nix +++ b/lib/make-iso9660-image.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation { name = "iso9660-image"; builder = ./make-iso9660-image.sh; buildInputs = [perl cdrkit]; - + inherit isoName bootable bootImage compressImage volumeID pathsFromGraph; # !!! should use XML. @@ -46,7 +46,7 @@ stdenv.mkDerivation { # !!! should use XML. objects = map (x: x.object) storeContents; symlinks = map (x: x.symlink) storeContents; - + # For obtaining the closure of `storeContents'. exportReferencesGraph = map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents; diff --git a/lib/make-squashfs.nix b/lib/make-squashfs.nix index 1bd93b8ffaf..3b640334e17 100644 --- a/lib/make-squashfs.nix +++ b/lib/make-squashfs.nix @@ -7,9 +7,9 @@ stdenv.mkDerivation { name = "squashfs.img"; - + buildInputs = [perl squashfsTools]; - + # For obtaining the closure of `storeContents'. exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) storeContents; @@ -18,7 +18,7 @@ stdenv.mkDerivation { '' # Add the closures of the top-level store objects. storePaths=$(perl ${pathsFromGraph} closure-*) - + # Also include a manifest of the closures in a format suitable # for nix-store --load-db. printRegistration=1 perl ${pathsFromGraph} closure-* > nix-path-registration diff --git a/lib/make-system-tarball.nix b/lib/make-system-tarball.nix index 301294e1964..8fed9a34882 100644 --- a/lib/make-system-tarball.nix +++ b/lib/make-system-tarball.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { name = "tarball"; builder = ./make-system-tarball.sh; buildInputs = [perl xz]; - + inherit fileName pathsFromGraph; # !!! should use XML. @@ -31,7 +31,7 @@ stdenv.mkDerivation { # !!! should use XML. objects = map (x: x.object) storeContents; symlinks = map (x: x.symlink) storeContents; - + # For obtaining the closure of `storeContents'. exportReferencesGraph = map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents; diff --git a/lib/testing.nix b/lib/testing.nix index 94f5a4cb70e..9b49bad580f 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -14,13 +14,13 @@ rec { buildInputs = [ makeWrapper perl ]; unpackPhase = "true"; - + installPhase = '' mkdir -p $out/bin cp ${./test-driver/test-driver.pl} $out/bin/nixos-test-driver chmod u+x $out/bin/nixos-test-driver - + libDir=$out/lib/perl5/site_perl mkdir -p $libDir cp ${./test-driver/Machine.pm} $libDir/Machine.pm @@ -38,9 +38,9 @@ rec { runTests = driver: stdenv.mkDerivation { name = "vm-test-run"; - + requiredSystemFeatures = [ "kvm" ]; - + buildInputs = [ pkgs.libxslt ]; buildCommand = @@ -49,7 +49,7 @@ rec { LOGFILE=$out/log.xml tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver || failed=1 - # Generate a pretty-printed log. + # Generate a pretty-printed log. xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml ln -s ${./test-driver/logfile.css} $out/logfile.css ln -s ${./test-driver/treebits.js} $out/treebits.js @@ -96,12 +96,12 @@ rec { done find $TMPDIR/gcov -name "*.gcda" -exec chmod 644 {} \; - + echo "producing info..." ${pkgs.lcov}/bin/geninfo --ignore-errors source,gcov $TMPDIR/gcov --output-file $TMPDIR/app.info cat $TMPDIR/app.info >> $TMPDIR/full.info done - + echo "making report..." mkdir -p $out/coverage ${pkgs.lcov}/bin/genhtml --show-details $TMPDIR/full.info -o $out/coverage @@ -131,11 +131,11 @@ rec { if builtins.isFunction t.testScript then t.testScript { inherit nodes; } else t.testScript; - + vlans = map (m: m.config.virtualisation.vlans) (lib.attrValues nodes); vms = map (m: m.config.system.build.vm) (lib.attrValues nodes); - + # Generate onvenience wrappers for running the test driver # interactively with the specified network, and for starting the # VMs from the command line. @@ -161,11 +161,11 @@ rec { ''; # " test = runTests driver; - + report = makeReport test; }; - + runInMachine = { drv , machine @@ -181,12 +181,12 @@ rec { buildrunner = writeText "vm-build" '' source $1 - + ${coreutils}/bin/mkdir -p $TMPDIR cd $TMPDIR - + $origBuilder $origArgs - + exit $? ''; @@ -211,10 +211,10 @@ rec { builder = "${bash}/bin/sh"; args = ["-e" vmRunCommand]; origArgs = attrs.args; - origBuilder = attrs.builder; + origBuilder = attrs.builder; }); - + runInMachineWithX = { require ? [], ... } @ args: let client = @@ -238,7 +238,7 @@ rec { ''; } // args); - + simpleTest = as: (makeTest ({ ... }: as)).test; } diff --git a/maintainers/option-usages.nix b/maintainers/option-usages.nix index 175ae9f0821..e0532e9e548 100644 --- a/maintainers/option-usages.nix +++ b/maintainers/option-usages.nix @@ -17,7 +17,7 @@ # there dependencies to track problems and their sources. let - + evalFun = { extraArgs ? {} }: import ../lib/eval-config.nix { diff --git a/modules/config/fonts.nix b/modules/config/fonts.nix index af5ebde2d47..3516ed75ab6 100644 --- a/modules/config/fonts.nix +++ b/modules/config/fonts.nix @@ -35,8 +35,8 @@ let enableFontDir = mkOption { default = false; description = " - Whether to create a directory with links to all fonts in share - - so user can configure vncserver script one time (I mean per-user + Whether to create a directory with links to all fonts in share - + so user can configure vncserver script one time (I mean per-user vncserver, so global service is not a good solution). "; }; @@ -122,7 +122,7 @@ let for i in \$list ; do fontDirs=\"\$fontDirs \$(dirname \$i)\"; done; - mkdir -p \$out/share/X11-fonts/; + mkdir -p \$out/share/X11-fonts/; find \$fontDirs -type f -o -type l | while read i; do j=\"\${i##*/}\" if ! test -e \"\$out/share/X11-fonts/\${j}\"; then @@ -142,7 +142,7 @@ let x11Fonts = with localDefs; stdenv.mkDerivation rec { name = "X11-fonts"; builder = writeScript (name + "-builder") - (textClosure localDefs + (textClosure localDefs [installPhase doForceShare doPropagate]); meta = { description = " @@ -169,7 +169,7 @@ in ]; environment.shellInit = - '' + '' export FONTCONFIG_FILE=/etc/fonts/fonts.conf ''; diff --git a/modules/config/krb5.nix b/modules/config/krb5.nix index 7ff0b498562..56854603264 100644 --- a/modules/config/krb5.nix +++ b/modules/config/krb5.nix @@ -29,7 +29,7 @@ let description = "Kerberos Domain Controller"; }; - kerberosAdminServer = mkOption { + kerberosAdminServer = mkOption { default = "kerberos.mit.edu"; description = "Kerberos Admin Server"; }; diff --git a/modules/config/ldap.nix b/modules/config/ldap.nix index 3bf1aa9d74d..56f693f362e 100644 --- a/modules/config/ldap.nix +++ b/modules/config/ldap.nix @@ -69,7 +69,7 @@ mkIf config.users.ldap.enable { ''; target = "ldap.conf"; } - + ]; }; diff --git a/modules/config/networking.nix b/modules/config/networking.nix index 65f22445b06..076b9801a54 100644 --- a/modules/config/networking.nix +++ b/modules/config/networking.nix @@ -13,7 +13,7 @@ let Additional entries to be appended to /etc/hosts. ''; }; - + }; in diff --git a/modules/config/power-management.nix b/modules/config/power-management.nix index 97b7f61c473..cb7047a2ba8 100644 --- a/modules/config/power-management.nix +++ b/modules/config/power-management.nix @@ -28,7 +28,7 @@ in ###### interface options = { - + powerManagement = { enable = mkOption { @@ -44,7 +44,7 @@ in default = ""; description = "Commands executed after the system resumes from suspend-to-RAM."; }; - + powerUpCommands = mkOption { default = ""; example = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda"; @@ -66,11 +66,11 @@ in it goes to suspend or hibernation. ''; }; - + }; - + }; - + ###### implementation @@ -86,11 +86,11 @@ in target = "pm/sleep.d/00sleep-hook"; }; - boot.kernelModules = - [ "acpi_cpufreq" "cpufreq_performance" "cpufreq_powersave" "cpufreq_ondemand" + boot.kernelModules = + [ "acpi_cpufreq" "cpufreq_performance" "cpufreq_powersave" "cpufreq_ondemand" "p4_clockmod" ]; - + }; } diff --git a/modules/config/pulseaudio.nix b/modules/config/pulseaudio.nix index 943b300b9a7..71bf0081e4e 100644 --- a/modules/config/pulseaudio.nix +++ b/modules/config/pulseaudio.nix @@ -7,7 +7,7 @@ let cfg = config.hardware.pulseaudio; in { options = { - + hardware.pulseaudio.enable = mkOption { default = false; description = '' @@ -26,7 +26,7 @@ let cfg = config.hardware.pulseaudio; in }; }; - + config = mkIf cfg.enable { @@ -46,7 +46,7 @@ let cfg = config.hardware.pulseaudio; in ''} ''; } - + ] ++ optionals cfg.enable [ # Write an /etc/asound.conf that causes all ALSA applications to # be re-routed to the PulseAudio server through ALSA's Pulse @@ -57,16 +57,16 @@ let cfg = config.hardware.pulseaudio; in pcm_type.pulse { lib ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so } - + pcm.!default { type pulse hint.description "Default Audio Device (via PulseAudio)" } - + ctl_type.pulse { lib ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so } - + ctl.!default { type pulse } @@ -85,7 +85,7 @@ let cfg = config.hardware.pulseaudio; in # Allow PulseAudio to get realtime priority using rtkit. security.rtkit.enable = true; - + }; } diff --git a/modules/config/shells.nix b/modules/config/shells.nix index 53d445b0ead..6286223752a 100644 --- a/modules/config/shells.nix +++ b/modules/config/shells.nix @@ -18,6 +18,6 @@ with pkgs.lib; ''; }; - }; + }; } diff --git a/modules/config/swap.nix b/modules/config/swap.nix index a3f241fc8c5..1e373382917 100644 --- a/modules/config/swap.nix +++ b/modules/config/swap.nix @@ -5,7 +5,7 @@ with pkgs.lib; { ###### interface - + options = { swapDevices = mkOption { @@ -30,7 +30,7 @@ with pkgs.lib; options = {config, options, ...}: { options = { - + device = mkOption { example = "/dev/sda3"; type = types.string; @@ -64,9 +64,9 @@ with pkgs.lib; else mkNotdef; }; - + }; - + }; }; diff --git a/modules/config/system-path.nix b/modules/config/system-path.nix index 26685ae15f4..286f7993f77 100644 --- a/modules/config/system-path.nix +++ b/modules/config/system-path.nix @@ -8,7 +8,7 @@ with pkgs.lib; let cfg = config.environment; - + requiredPackages = [ config.system.sbin.modprobe # must take precedence over module_init_tools config.system.sbin.mount # must take precedence over util-linux @@ -91,7 +91,7 @@ let description = '' The packages you want in the boot environment. ''; - + apply = list: pkgs.buildEnv { name = "system-path"; paths = list; @@ -109,11 +109,11 @@ let fi ''; }; - + }; }; - + }; diff --git a/modules/config/unix-odbc-drivers.nix b/modules/config/unix-odbc-drivers.nix index 7df87db8577..8950898e1dd 100644 --- a/modules/config/unix-odbc-drivers.nix +++ b/modules/config/unix-odbc-drivers.nix @@ -10,7 +10,7 @@ let default = []; example = "map (x : x.ini) (with pkgs.unixODBCDrivers; [ mysql psql psqlng ] )"; description = '' - specifies unix odbc drivers to be registered at /etc/odbcinst.ini. + specifies unix odbc drivers to be registered at /etc/odbcinst.ini. Maybe you also want to add pkgs.unixODBC to the system path to get a command line client t connnect to odbc databases. ''; @@ -30,10 +30,10 @@ mkIf (config.environment.unixODBCDrivers != []) { require = [ options ]; - + environment = { etc = [ - { source = + { source = let inis = config.environment.unixODBCDrivers; in pkgs.writeText "odbcinst.ini" (pkgs.lib.concatStringsSep "\n" inis); target = "odbcinst.ini"; diff --git a/modules/config/users-groups.nix b/modules/config/users-groups.nix index a0210630b0f..19ec0655ab1 100644 --- a/modules/config/users-groups.nix +++ b/modules/config/users-groups.nix @@ -6,7 +6,7 @@ let ids = config.ids; - + # User accounts to be created/updated by NixOS. users = let @@ -46,7 +46,7 @@ let # Groups to be created/updated by NixOS. groups = let - defaultGroups = + defaultGroups = [ { name = "root"; gid = ids.gids.root; } @@ -108,10 +108,10 @@ let # having an empty password, and not having a password. serializedUser = u: "${u.name}\n${u.description}\n${toString u.uid}\n${u.group}\n${toString (concatStringsSep "," u.extraGroups)}\n${u.home}\n${u.shell}\n${toString u.createHome}\n${if u.password != null then "X" + u.password else ""}\n${toString u.isSystemUser}\n"; serializedGroup = g: "${g.name}\n${toString g.gid}"; - + # keep this extra file so that cat can be used to pass special chars such as "`" which is used in the avahi daemon usersFile = pkgs.writeText "users" (concatStrings (map serializedUser users)); - + in { @@ -119,7 +119,7 @@ in ###### interface options = { - + users.extraUsers = mkOption { default = []; example = @@ -152,7 +152,7 @@ in }; }; - + ###### implementation @@ -230,7 +230,7 @@ in system.activationScripts.groups = stringAfter [ "rootPasswd" "binsh" "etc" "var" ] '' echo "updating groups..." - + while true; do read name || break read gid diff --git a/modules/hardware/network/intel-2100bg.nix b/modules/hardware/network/intel-2100bg.nix index aec4f9748dc..b2eea6c7b90 100644 --- a/modules/hardware/network/intel-2100bg.nix +++ b/modules/hardware/network/intel-2100bg.nix @@ -5,7 +5,7 @@ ###### interface options = { - + networking.enableIntel2100BGFirmware = pkgs.lib.mkOption { default = false; type = pkgs.lib.types.bool; @@ -22,13 +22,13 @@ ###### implementation - + config = pkgs.lib.mkIf config.networking.enableIntel2100BGFirmware { - + # Warning: setting this option requires acceptance of the firmware # license, see http://ipw2100.sourceforge.net/firmware.php?fid=2. hardware.firmware = [ pkgs.ipw2100fw ]; }; - + } diff --git a/modules/hardware/network/intel-2200bg.nix b/modules/hardware/network/intel-2200bg.nix index dc67e1335fe..5804eabded5 100644 --- a/modules/hardware/network/intel-2200bg.nix +++ b/modules/hardware/network/intel-2200bg.nix @@ -5,7 +5,7 @@ ###### interface options = { - + networking.enableIntel2200BGFirmware = pkgs.lib.mkOption { default = false; type = pkgs.lib.types.bool; @@ -22,13 +22,13 @@ ###### implementation - + config = pkgs.lib.mkIf config.networking.enableIntel2200BGFirmware { - + # Warning: setting this option requires acceptance of the firmware # license, see http://ipw2200.sourceforge.net/firmware.php?fid=7. hardware.firmware = [ pkgs.ipw2200fw ]; }; - + } diff --git a/modules/hardware/network/intel-3945abg.nix b/modules/hardware/network/intel-3945abg.nix index 9fe4be500f1..3500fc2ff68 100644 --- a/modules/hardware/network/intel-3945abg.nix +++ b/modules/hardware/network/intel-3945abg.nix @@ -5,7 +5,7 @@ ###### interface options = { - + networking.enableIntel3945ABGFirmware = pkgs.lib.mkOption { default = false; type = pkgs.lib.types.bool; @@ -19,11 +19,11 @@ ###### implementation - + config = pkgs.lib.mkIf config.networking.enableIntel3945ABGFirmware { - + hardware.firmware = [ pkgs.iwlwifi3945ucode ]; }; - + } diff --git a/modules/hardware/network/rt73.nix b/modules/hardware/network/rt73.nix index f7fae009528..6e96f21104d 100644 --- a/modules/hardware/network/rt73.nix +++ b/modules/hardware/network/rt73.nix @@ -5,7 +5,7 @@ ###### interface options = { - + networking.enableRT73Firmware = pkgs.lib.mkOption { default = false; type = pkgs.lib.types.bool; @@ -18,9 +18,9 @@ ###### implementation - + config = pkgs.lib.mkIf config.networking.enableRT73Firmware { hardware.firmware = [ pkgs.rt73fw ]; }; - + } diff --git a/modules/hardware/network/rtl8192c.nix b/modules/hardware/network/rtl8192c.nix index f02948745bb..aeb573fb0ea 100644 --- a/modules/hardware/network/rtl8192c.nix +++ b/modules/hardware/network/rtl8192c.nix @@ -5,7 +5,7 @@ ###### interface options = { - + networking.enableRTL8192cFirmware = pkgs.lib.mkOption { default = false; type = pkgs.lib.types.bool; @@ -18,9 +18,9 @@ ###### implementation - + config = pkgs.lib.mkIf config.networking.enableRTL8192cFirmware { hardware.firmware = [ pkgs.rtl8192cfw ]; }; - + } diff --git a/modules/hardware/video/encoder/wis-go7007.nix b/modules/hardware/video/encoder/wis-go7007.nix index 3936b333af4..c0eb2b814b3 100644 --- a/modules/hardware/video/encoder/wis-go7007.nix +++ b/modules/hardware/video/encoder/wis-go7007.nix @@ -10,6 +10,6 @@ in environment.systemPackages = [wis_go7007]; hardware.firmware = ["${wis_go7007}/firmware"]; - + services.udev.packages = [wis_go7007]; } diff --git a/modules/installer/cd-dvd/installation-cd-base.nix b/modules/installer/cd-dvd/installation-cd-base.nix index a011861ea36..564916d099f 100644 --- a/modules/installer/cd-dvd/installation-cd-base.nix +++ b/modules/installer/cd-dvd/installation-cd-base.nix @@ -25,7 +25,7 @@ let nixpkgsTarball = makeTarball "nixpkgs.tar.bz2" (cleanSource pkgs.path); includeSources = true; - + in { @@ -40,9 +40,9 @@ in # ISO naming. isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixosVersion}-${pkgs.stdenv.system}.iso"; - + isoImage.volumeID = "NIXOS_INSTALL_CD_${config.system.nixosVersion}"; - + boot.postBootCommands = '' export PATH=${pkgs.gnutar}/bin:${pkgs.bzip2}/bin:$PATH diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index 6e1994cffc7..d565435ffd2 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -85,7 +85,7 @@ let # The configuration file for Grub. - grubCfg = + grubCfg = '' set default=${builtins.toString config.boot.loader.grub.default} set timeout=${builtins.toString config.boot.loader.grub.timeout} @@ -104,12 +104,12 @@ let set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi - + fi ${config.boot.loader.grub.extraEntries} ''; - + in { @@ -154,13 +154,13 @@ in # We need squashfs in the initrd to mount the compressed Nix store, # and aufs to make the root filesystem appear writable. boot.extraModulePackages = - optional - (! ( config.boot.kernelPackages.kernel.features ? aufs || config.boot.kernelPackages.kernel.features ? aufs2_1 ) ) + optional + (! ( config.boot.kernelPackages.kernel.features ? aufs || config.boot.kernelPackages.kernel.features ? aufs2_1 ) ) config.boot.kernelPackages.aufs2 ++ optional ( config.boot.kernelPackages.kernel.features ? aufs2_1 ) config.boot.kernelPackages.aufs2_1; - + boot.initrd.availableKernelModules = [ "aufs" "squashfs" "iso9660" ]; boot.initrd.kernelModules = [ "loop" ]; @@ -184,7 +184,7 @@ in # Closures to be copied to the Nix store on the CD, namely the init # script and the top-level system configuration directory. isoImage.storeContents = - [ config.system.build.toplevel ] ++ + [ config.system.build.toplevel ] ++ optional config.isoImage.includeSystemBuildDependencies config.system.build.toplevel.drvPath; @@ -237,13 +237,13 @@ in chainloader +1 } ''; - + boot.loader.grub.timeout = 10; # Create the ISO image. system.build.isoImage = import ../../../lib/make-iso9660-image.nix { inherit (pkgs) stdenv perl cdrkit pathsFromGraph; - + inherit (config.isoImage) isoName compressImage volumeID contents; bootable = true; diff --git a/modules/installer/cd-dvd/live-dvd.nix b/modules/installer/cd-dvd/live-dvd.nix index 4857900389c..c5a89a3173e 100644 --- a/modules/installer/cd-dvd/live-dvd.nix +++ b/modules/installer/cd-dvd/live-dvd.nix @@ -23,32 +23,32 @@ pkgs.patch pkgs.which pkgs.diffutils - pkgs.file + pkgs.file pkgs.irssi pkgs.mcabber - pkgs.mutt + pkgs.mutt pkgs.emacs pkgs.vimHugeX - pkgs.bvi + pkgs.bvi pkgs.ddrescue - pkgs.cdrkit + pkgs.cdrkit pkgs.btrfsProgs pkgs.xfsprogs pkgs.jfsutils pkgs.jfsrec - pkgs.ntfs3g + pkgs.ntfs3g pkgs.subversion16 pkgs.monotone pkgs.git pkgs.darcs pkgs.mercurial pkgs.bazaar - pkgs.cvs + pkgs.cvs pkgs.pciutils pkgs.hddtemp pkgs.sdparm pkgs.hdparm - pkgs.usbutils + pkgs.usbutils pkgs.openssh pkgs.lftp pkgs.w3m @@ -64,9 +64,9 @@ pkgs.unzip pkgs.lzma pkgs.cabextract - pkgs.cpio + pkgs.cpio pkgs.lsof - pkgs.ltrace + pkgs.ltrace pkgs.perl pkgs.python pkgs.ruby @@ -74,5 +74,5 @@ pkgs.clisp pkgs.tcl ]; - + } diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 7ece0716df6..a0b92369f65 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -24,7 +24,7 @@ let nixpkgs.config.platform = pkgs.platforms.fuloong2f_n32; } ''; - + pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l; @@ -51,7 +51,7 @@ let platform = pkgs.platforms.fuloong2f_n32; } ''; - + in { @@ -104,7 +104,7 @@ in pkgs.zip pkgs.xz pkgs.dar # disk archiver - + # Some editors. pkgs.nvi pkgs.bvi # binary editor @@ -134,7 +134,7 @@ in # Some more help text. services.mingetty.helpLine = '' - + Log in as "root" with an empty password. ${ if config.services.xserver.enable then "Type `start xserver' to start\nthe graphical user interface." diff --git a/modules/installer/cd-dvd/system-tarball-pc.nix b/modules/installer/cd-dvd/system-tarball-pc.nix index 9f81695452c..8b916b04fd9 100644 --- a/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/modules/installer/cd-dvd/system-tarball-pc.nix @@ -40,21 +40,21 @@ let # Example configuration for booting PXE. allow booting; allow bootp; - + # Adapt this to your network configuration. option domain-name "local"; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; option domain-name-servers 192.168.1.1; option routers 192.168.1.1; - + # PXE-specific configuration directives... # Some BIOS don't accept slashes for paths inside the tftp servers, # and will report Access Violation if they see slashes. filename "pxelinux.0"; # For the TFTP and NFS root server. Set the IP of your server. next-server 192.168.1.34; - + subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.50 192.168.1.55; } @@ -86,7 +86,7 @@ let You can test qemu pxe boot without having a DHCP server adapted, but having nfsroot, like this: - qemu-system-x86_64 -tftp /home/pcroot/boot -net nic -net user,bootfile=pxelinux.0 -boot n + qemu-system-x86_64 -tftp /home/pcroot/boot -net nic -net user,bootfile=pxelinux.0 -boot n I don't know how to use NFS through the qemu '-net user' though. @@ -114,7 +114,7 @@ in { require = [ ./system-tarball.nix - + # Profiles of this basic installation. ../../profiles/base.nix ../../profiles/installation-device.nix @@ -150,7 +150,7 @@ in target = "/boot/memtest"; } ]; - + # Allow sshd to be started manually through "start sshd". It should # not be started by default on the installation CD because the # default root password is empty. diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index f8b6b632ea7..c5f6de4c221 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -25,7 +25,7 @@ let # services.openssh.enable = true; } ''; - + pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l; @@ -45,7 +45,7 @@ let init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} ''; - + in { @@ -91,7 +91,7 @@ in pkgs.zip pkgs.xz pkgs.dar # disk archiver - + # Some editors. pkgs.nvi pkgs.bvi # binary editor diff --git a/modules/installer/cd-dvd/system-tarball.nix b/modules/installer/cd-dvd/system-tarball.nix index a829b85b59f..daffb94bc53 100644 --- a/modules/installer/cd-dvd/system-tarball.nix +++ b/modules/installer/cd-dvd/system-tarball.nix @@ -68,7 +68,7 @@ in # Create the tarball system.build.tarball = import ../../../lib/make-system-tarball.nix { inherit (pkgs) stdenv perl xz pathsFromGraph; - + inherit (config.tarball) contents storeContents; }; diff --git a/modules/installer/grub/grub.nix b/modules/installer/grub/grub.nix index 50ae0ddb596..eaafec78653 100644 --- a/modules/installer/grub/grub.nix +++ b/modules/installer/grub/grub.nix @@ -16,7 +16,7 @@ let extraConfig extraEntries extraEntriesBeforeNixOS extraPerEntryConfig splashImage configurationLimit version default timeout; }; - + in { @@ -146,7 +146,7 @@ in timeout = mkOption { default = 5; description = '' - Timeout (in seconds) until GRUB boots the default menu item. + Timeout (in seconds) until GRUB boots the default menu item. ''; }; @@ -160,12 +160,12 @@ in }; }; - + ###### implementation config = mkIf config.boot.loader.grub.enable { - + system.build.menuBuilder = grubMenuBuilder; # Common attribute for boot loaders so only one of them can be @@ -178,5 +178,5 @@ in system.build.grub = grub; }; - + } diff --git a/modules/installer/init-script/init-script.nix b/modules/installer/init-script/init-script.nix index 9eeadca109f..edf7d23d2a7 100644 --- a/modules/installer/init-script/init-script.nix +++ b/modules/installer/init-script/init-script.nix @@ -10,7 +10,7 @@ let inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; }; - + in { @@ -37,15 +37,15 @@ in }; }; - + ###### implementation config = { - + system.build.initScriptBuilder = if config.boot.loader.initScript.enable then initScriptBuilder else ""; }; - + } diff --git a/modules/installer/tools/nixos-checkout.nix b/modules/installer/tools/nixos-checkout.nix index 2d7304ea68d..74a22bc84f5 100644 --- a/modules/installer/tools/nixos-checkout.nix +++ b/modules/installer/tools/nixos-checkout.nix @@ -32,7 +32,7 @@ let ${pkgs.subversion}/bin/svn co https://svn.nixos.org/repos/nix/nixpkgs/trunk nixpkgs ''; }; - + in { diff --git a/modules/installer/tools/nixos-deploy-network/deploy.nix b/modules/installer/tools/nixos-deploy-network/deploy.nix index 5eda39269ca..7ece202a990 100644 --- a/modules/installer/tools/nixos-deploy-network/deploy.nix +++ b/modules/installer/tools/nixos-deploy-network/deploy.nix @@ -6,16 +6,16 @@ let pkgs = import nixpkgs {}; - + inherit (builtins) attrNames getAttr listToAttrs; inherit (pkgs.lib) concatMapStrings zipAttrs; - + networks = map (networkExpr: import networkExpr) networkExprs; - + network = zipAttrs networks; - + generateRollbackSucceededPhase = network: configs: - concatMapStrings (configurationName: + concatMapStrings (configurationName: let config = getAttr configurationName configs; in @@ -24,15 +24,15 @@ let then ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch - + rollback=$((rollback + 1)) fi '' - ) (attrNames network) + ) (attrNames network) ; - + generateDistributionPhase = network: configs: - concatMapStrings (configurationName: + concatMapStrings (configurationName: let config = getAttr configurationName configs; in @@ -42,28 +42,28 @@ let '' ) (attrNames network) ; - + generateActivationPhase = network: configs: - concatMapStrings (configurationName: + concatMapStrings (configurationName: let config = getAttr configurationName configs; in '' echo "=== activating system configuration on ${getAttr targetProperty (config.deployment)} ===" - ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} || + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} || (ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback; rollbackSucceeded) - + ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch || ( ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch rollbackSucceeded ) - + succeeded=$((succeeded + 1)) '' ) (attrNames network) ; - + evaluateMachines = network: listToAttrs (map (configurationName: let @@ -93,27 +93,27 @@ pkgs.stdenv.mkDerivation { # This script has a zillion dependencies and is trivial to build, so # we don't want to build it remotely. preferLocalBuild = true; - - buildCommand = + + buildCommand = '' ensureDir $out/bin cat > $out/bin/deploy-systems << "EOF" #! ${pkgs.stdenv.shell} -e - + rollbackSucceeded() { rollback=0 ${generateRollbackSucceededPhase network configs} } - + # Distribution phase - + ${generateDistributionPhase network configs} - + # Activation phase - + succeeded=0 - + ${generateActivationPhase network configs} EOF chmod +x $out/bin/deploy-systems diff --git a/modules/misc/assertions.nix b/modules/misc/assertions.nix index c2a94311a28..2b06bfbbc03 100644 --- a/modules/misc/assertions.nix +++ b/modules/misc/assertions.nix @@ -7,7 +7,7 @@ let failed = map (x: x.message) (filter (x: !x.assertion) config.assertions); in - + { options = { @@ -33,5 +33,5 @@ in else throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failed)}"; }; - + } diff --git a/modules/misc/deployment.nix b/modules/misc/deployment.nix index 93ae8c97e98..068a9feadce 100644 --- a/modules/misc/deployment.nix +++ b/modules/misc/deployment.nix @@ -4,7 +4,7 @@ with pkgs.lib; { options = { - + deployment.targetEnv = mkOption { default = "none"; example = "ec2"; @@ -37,7 +37,7 @@ with pkgs.lib; }; # EC2/Nova/Eucalyptus-specific options. - + deployment.ec2.type = mkOption { default = "ec2"; example = "nova"; @@ -63,7 +63,7 @@ with pkgs.lib; machine. This must be a NixOS image providing SSH access. ''; }; - + deployment.ec2.instanceType = mkOption { default = "m1.small"; example = "m1.large"; @@ -93,7 +93,7 @@ with pkgs.lib; SSH) to execute commands to start VMs or query their status. ''; }; - + deployment.adhoc.createVMCommand = mkOption { default = "create-vm"; description = '' @@ -101,7 +101,7 @@ with pkgs.lib; print an identifier denoting the VM on standard output. ''; }; - + deployment.adhoc.destroyVMCommand = mkOption { default = "destroy-vm"; description = '' @@ -109,7 +109,7 @@ with pkgs.lib; machine. ''; }; - + deployment.adhoc.queryVMCommand = mkOption { default = "query-vm"; description = '' @@ -118,6 +118,6 @@ with pkgs.lib; the VM on standard output. ''; }; - + }; } diff --git a/modules/misc/ids.nix b/modules/misc/ids.nix index 4181cd53ef8..7415685f707 100644 --- a/modules/misc/ids.nix +++ b/modules/misc/ids.nix @@ -22,7 +22,7 @@ let }; in - + { require = options; @@ -51,7 +51,7 @@ in uptimed = 29; ddclient = 30; davfs2 = 31; - privoxy = 32; + privoxy = 32; osgi = 34; tor = 35; cups = 36; diff --git a/modules/misc/locate.nix b/modules/misc/locate.nix index 3e249007dc3..e24fa2d078c 100644 --- a/modules/misc/locate.nix +++ b/modules/misc/locate.nix @@ -35,7 +35,7 @@ in ###### implementation let locatedb = "/var/cache/locatedb"; - + updatedbCmd = "${config.services.locate.period} root " + "mkdir -m 0755 -p $(dirname ${locatedb}) && " + diff --git a/modules/misc/nixpkgs.nix b/modules/misc/nixpkgs.nix index 73332bd96a8..2530b5af3e5 100644 --- a/modules/misc/nixpkgs.nix +++ b/modules/misc/nixpkgs.nix @@ -43,7 +43,7 @@ in firefox60Pkgs = pkgs.firefox60Pkgs.override { enableOfficialBranding = true; }; - }; + }; } ''; type = configType; diff --git a/modules/misc/passthru.nix b/modules/misc/passthru.nix index 5aacf507afb..9962352a40a 100644 --- a/modules/misc/passthru.nix +++ b/modules/misc/passthru.nix @@ -1,9 +1,9 @@ # This module allows you to export something from configuration -# Use case: export kernel source expression for ease of configuring +# Use case: export kernel source expression for ease of configuring {config, pkgs, ...}: -let +let options = { passthru = pkgs.lib.mkOption { @@ -14,7 +14,7 @@ options = { }; }; -in +in { require = options; diff --git a/modules/profiles/installation-device.nix b/modules/profiles/installation-device.nix index 9573b933320..10f47840e06 100644 --- a/modules/profiles/installation-device.nix +++ b/modules/profiles/installation-device.nix @@ -144,7 +144,7 @@ in # Some more help text. services.mingetty.helpLine = '' - + Log in as "root" with an empty password. ${ if config.services.xserver.enable then "Type `start xserver' to start\nthe graphical user interface." diff --git a/modules/profiles/rescue.nix b/modules/profiles/rescue.nix index b3b830e6618..8d9c41987de 100644 --- a/modules/profiles/rescue.nix +++ b/modules/profiles/rescue.nix @@ -8,19 +8,19 @@ # Useful for rescue.. environment.systemPackages = with pkgs; [ - utillinuxCurses ddrescue + utillinuxCurses ddrescue pciutils sdparm hdparm hddtemp usbutils btrfsProgs xfsprogs jfsutils jfsrec - iproute + iproute fuse ntfs3g smbfsFuse sshfsFuse - manpages irssi elinks mcabber mutt openssh lftp + manpages irssi elinks mcabber mutt openssh lftp openssl ncat socat gnupg1 gnupg patch which diffutils gcc binutils bc file screen - bvi joe nvi + bvi joe nvi subversion16 monotone git darcs mercurial bazaar cvs - unrar unzip zip lzma cabextract cpio + unrar unzip zip lzma cabextract cpio lsof ]; diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index 8df97ceac5f..92c2a5b7755 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -20,8 +20,8 @@ let }; -in - +in + { require = [options]; @@ -52,7 +52,7 @@ in target = "skel/.bashrc"; mode = "0644"; } - + { # Configuration for readline in bash. source = ./inputrc; target = "inputrc"; @@ -68,5 +68,5 @@ in mkdir -m 0755 -p /bin ln -sfn ${config.system.build.binsh}/bin/sh /bin/sh ''; - + } diff --git a/modules/programs/info.nix b/modules/programs/info.nix index e3b8025f933..044c0995681 100644 --- a/modules/programs/info.nix +++ b/modules/programs/info.nix @@ -29,7 +29,7 @@ let INFOPATH=$dir:$INFOPATH ${pkgs.texinfo}/bin/info "$@" ''; # */ -in +in { environment.systemPackages = [infoWrapper]; diff --git a/modules/programs/shadow.nix b/modules/programs/shadow.nix index 81286d9bb5c..8af94c48cce 100644 --- a/modules/programs/shadow.nix +++ b/modules/programs/shadow.nix @@ -31,7 +31,7 @@ in { ###### interface - + options = { users.defaultUserShell = pkgs.lib.mkOption { @@ -44,10 +44,10 @@ in actual shell in the Nix store. ''; }; - + }; - + ###### implementation config = { @@ -56,10 +56,10 @@ in environment.etc = [ { # /etc/login.defs: global configuration for pwdutils. You - # cannot login without it! + # cannot login without it! source = pkgs.writeText "login.defs" loginDefs; target = "login.defs"; - } + } { # /etc/default/useradd: configuration for useradd. source = pkgs.writeText "useradd" @@ -84,14 +84,14 @@ in { name = "usermod"; rootOK = true; } { name = "userdel"; rootOK = true; } { name = "groupadd"; rootOK = true; } - { name = "groupmod"; rootOK = true; } + { name = "groupmod"; rootOK = true; } { name = "groupmems"; rootOK = true; } { name = "groupdel"; rootOK = true; } { name = "login"; ownDevices = true; allowNullPassword = true; } ]; - + security.setuidPrograms = [ "passwd" "chfn" "su" ]; - + }; - + } diff --git a/modules/security/ca.nix b/modules/security/ca.nix index 456f91b81e2..ef33298f19e 100644 --- a/modules/security/ca.nix +++ b/modules/security/ca.nix @@ -25,7 +25,7 @@ with pkgs.lib; export CURL_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt ''; - + }; } diff --git a/modules/security/consolekit.nix b/modules/security/consolekit.nix index 6d3121903e3..28e1fec0601 100644 --- a/modules/security/consolekit.nix +++ b/modules/security/consolekit.nix @@ -13,7 +13,7 @@ let name = "var-run-console.ck"; destination = "/etc/ConsoleKit/run-session.d/var-run-console.ck"; executable = true; - + text = '' #! ${pkgs.stdenv.shell} -e diff --git a/modules/security/policykit.nix b/modules/security/policykit.nix index 747ad24922e..0d56a519e81 100644 --- a/modules/security/policykit.nix +++ b/modules/security/policykit.nix @@ -20,7 +20,7 @@ in { options = { - + security.policykit.enable = mkOption { default = false; description = "Enable PolicyKit (obsolete)."; @@ -60,7 +60,7 @@ in target = "PolicyKit/policy"; } ]; - + system.activationScripts.policyKit = stringAfter [ "users" ] '' mkdir -m 0770 -p /var/run/PolicyKit @@ -68,7 +68,7 @@ in mkdir -m 0770 -p /var/lib/PolicyKit chown root.polkituser /var/lib/PolicyKit - + mkdir -p /var/lib/misc touch /var/lib/misc/PolicyKit.reload chmod 0664 /var/lib/misc/PolicyKit.reload diff --git a/modules/security/polkit.nix b/modules/security/polkit.nix index ac8d68a4d4f..fef52f1fed6 100644 --- a/modules/security/polkit.nix +++ b/modules/security/polkit.nix @@ -68,7 +68,7 @@ in environment.systemPackages = [ pkgs.polkit ]; - # The polkit daemon reads action files + # The polkit daemon reads action files environment.pathsToLink = [ "/share/polkit-1/actions" ]; environment.etc = @@ -86,7 +86,7 @@ in ''; target = "polkit-1/localauthority.conf.d/10-nixos.conf"; } - + { source = pkgs.writeText "org.nixos.pkla" cfg.permissions; target = "polkit-1/localauthority/10-vendor.d/org.nixos.pkla"; } @@ -95,7 +95,7 @@ in services.dbus.packages = [ pkgs.polkit ]; security.pam.services = [ { name = "polkit-1"; } ]; - + security.setuidPrograms = [ "pkexec" ]; security.setuidOwners = singleton @@ -115,7 +115,7 @@ in # configuration. ${pkgs.procps}/bin/pkill -INT -u root -x polkitd ''; - + }; } diff --git a/modules/security/rtkit.nix b/modules/security/rtkit.nix index 060ff87f9ea..e47e7baa2b8 100644 --- a/modules/security/rtkit.nix +++ b/modules/security/rtkit.nix @@ -8,7 +8,7 @@ with pkgs.lib; { options = { - + security.rtkit.enable = mkOption { default = false; description = '' @@ -20,7 +20,7 @@ with pkgs.lib; }; }; - + config = mkIf config.security.rtkit.enable { diff --git a/modules/security/setuid-wrappers.nix b/modules/security/setuid-wrappers.nix index 027032a7c27..ebd9e1ed537 100644 --- a/modules/security/setuid-wrappers.nix +++ b/modules/security/setuid-wrappers.nix @@ -102,7 +102,7 @@ in # system profile. source=/nix/var/nix/profiles/default/bin/${program} fi - + cp ${setuidWrapper}/bin/setuid-wrapper ${wrapperDir}/${program} echo -n "$source" > ${wrapperDir}/${program}.real chmod 0000 ${wrapperDir}/${program} # to prevent races @@ -110,7 +110,7 @@ in chmod "u${if setuid then "+" else "-"}s,g${if setgid then "+" else "-"}s,${permissions}" ${wrapperDir}/${program} ''; - in stringAfter [ "users" ] + in stringAfter [ "users" ] '' # Look in the system path and in the default profile for # programs to be wrapped. @@ -123,5 +123,5 @@ in ''; }; - + } diff --git a/modules/security/sudo.nix b/modules/security/sudo.nix index 845371050cc..694f868632d 100644 --- a/modules/security/sudo.nix +++ b/modules/security/sudo.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.security.sudo; - + inherit (pkgs) sudo; in diff --git a/modules/services/amqp/rabbitmq.nix b/modules/services/amqp/rabbitmq.nix index 3322ab329e7..88d6dc588d6 100644 --- a/modules/services/amqp/rabbitmq.nix +++ b/modules/services/amqp/rabbitmq.nix @@ -14,9 +14,9 @@ in ###### interface - + options = { - + services.rabbitmq = { enable = mkOption { @@ -74,7 +74,7 @@ in environment.HOME = "/var/lib/rabbitmq"; environment.RABBITMQ_NODE_IP_ADDRESS = cfg.listenAddress; - exec = + exec = '' ${run "${pkgs.rabbitmq_server}/sbin/rabbitmq-server"} ''; diff --git a/modules/services/audio/alsa.nix b/modules/services/audio/alsa.nix index 9181a86b377..ea0e1ef29c0 100644 --- a/modules/services/audio/alsa.nix +++ b/modules/services/audio/alsa.nix @@ -14,9 +14,9 @@ in { ###### interface - + options = { - + sound = { enable = mkOption { @@ -26,7 +26,7 @@ in ''; merge = mergeEnableOption; }; - + enableOSSEmulation = mkOption { default = true; description = '' @@ -35,14 +35,14 @@ in }; }; - + }; ###### implementation - + config = mkIf config.sound.enable { - + environment.systemPackages = [alsaUtils]; users.extraGroups = singleton @@ -78,7 +78,7 @@ in ${alsaUtils}/sbin/alsactl -f ${soundState} store ''; }; - + }; } diff --git a/modules/services/audio/pulseaudio.nix b/modules/services/audio/pulseaudio.nix index f48cdd49c83..04df2a8e867 100644 --- a/modules/services/audio/pulseaudio.nix +++ b/modules/services/audio/pulseaudio.nix @@ -14,9 +14,9 @@ in ###### interface options = { - + services.pulseaudio = { - + enable = mkOption { default = false; description = '' @@ -38,9 +38,9 @@ in }; }; - + }; - + ###### implementation @@ -83,5 +83,5 @@ in }; }; - + } diff --git a/modules/services/backup/mysql-backup.nix b/modules/services/backup/mysql-backup.nix index 7c091fcfe26..e1591050f7e 100644 --- a/modules/services/backup/mysql-backup.nix +++ b/modules/services/backup/mysql-backup.nix @@ -10,13 +10,13 @@ let location = cfg.location ; mysqlBackupCron = db : '' ${cfg.period} ${cfg.user} ${mysql}/bin/mysqldump ${if cfg.singleTransaction then "--single-transaction" else ""} ${db} | ${gzip}/bin/gzip -c > ${location}/${db}.gz - ''; + ''; in { options = { - + services.mysqlBackup = { enable = mkOption { @@ -48,7 +48,7 @@ in List of database names to dump. ''; }; - + location = mkOption { default = "/var/backup/mysql"; description = '' @@ -67,7 +67,7 @@ in }; config = mkIf config.services.mysqlBackup.enable { - + services.cron.systemCronJobs = map mysqlBackupCron config.services.mysqlBackup.databases; system.activationScripts.mysqlBackup = stringAfter [ "stdio" "defaultPath" "systemConfig" "users" ] @@ -75,7 +75,7 @@ in mkdir -m 0700 -p ${config.services.mysqlBackup.location} chown ${config.services.mysqlBackup.user} ${config.services.mysqlBackup.location} ''; - + }; - + } diff --git a/modules/services/backup/postgresql-backup.nix b/modules/services/backup/postgresql-backup.nix index edbbbdac635..f444717d514 100644 --- a/modules/services/backup/postgresql-backup.nix +++ b/modules/services/backup/postgresql-backup.nix @@ -10,14 +10,14 @@ let postgresqlBackupCron = db: '' ${config.services.postgresqlBackup.period} root ${postgresql}/bin/pg_dump ${db} | ${gzip}/bin/gzip -c > ${location}/${db}.gz - ''; + ''; in { options = { - + services.postgresqlBackup = { enable = mkOption { @@ -39,10 +39,10 @@ in databases = mkOption { default = []; description = '' - List of database names to dump. + List of database names to dump. ''; }; - + location = mkOption { default = "/var/backup/postgresql"; description = '' @@ -62,5 +62,5 @@ in chown root ${config.services.postgresqlBackup.location} ''; }; - + } diff --git a/modules/services/backup/sitecopy-backup.nix b/modules/services/backup/sitecopy-backup.nix index c540e8fcfa0..35ce55ef06c 100644 --- a/modules/services/backup/sitecopy-backup.nix +++ b/modules/services/backup/sitecopy-backup.nix @@ -9,13 +9,13 @@ let sitecopyCron = backup : '' ${if backup ? period then backup.period else config.services.sitecopy.period} root ${sitecopy}/bin/sitecopy --storepath=${stateDir} --rcfile=${stateDir}/${backup.name}.conf --update ${backup.name} - ''; + ''; in { options = { - + services.sitecopy = { enable = mkOption { @@ -36,8 +36,8 @@ in backups = mkOption { example = [ - { name = "test"; - local = "/tmp/backup"; + { name = "test"; + local = "/tmp/backup"; remote = "/staff-groups/ewi/st/strategoxt/backup/test"; server = "webdata.tudelft.nl"; protocol = "webdav"; @@ -47,15 +47,15 @@ in ]; default = []; description = '' - List of attributesets describing the backups. + List of attributesets describing the backups. - Username/password are extracted from ${stateDir}/sitecopy.secrets at activation + Username/password are extracted from ${stateDir}/sitecopy.secrets at activation time. The secrets file lines should have the following structure: server username password ''; - }; + }; }; @@ -67,7 +67,7 @@ in services.cron.systemCronJobs = map sitecopyCron config.services.sitecopy.backups; system.activationScripts.sitecopyBackup = stringAfter [ "stdio" "users" ] - '' + '' mkdir -m 0700 -p ${stateDir} chown root ${stateDir} touch ${stateDir}/sitecopy.secrets @@ -96,9 +96,9 @@ in else echo " * Sitecopy '${b.name}' already initialized" fi - '' ) config.services.sitecopy.backups + '' ) config.services.sitecopy.backups )} ''; }; - + } diff --git a/modules/services/databases/4store-endpoint.nix b/modules/services/databases/4store-endpoint.nix index ac38a9b7d54..7b03b4d8f1d 100644 --- a/modules/services/databases/4store-endpoint.nix +++ b/modules/services/databases/4store-endpoint.nix @@ -10,9 +10,9 @@ with pkgs.lib; ###### interface options = { - + services.fourStoreEndpoint = { - + enable = mkOption { default = false; description = "Whether to enable 4Store SPARQL endpoint."; @@ -68,5 +68,5 @@ with pkgs.lib; }; }); - + } diff --git a/modules/services/databases/4store.nix b/modules/services/databases/4store.nix index 1bc615681b6..14990e92ea3 100644 --- a/modules/services/databases/4store.nix +++ b/modules/services/databases/4store.nix @@ -11,9 +11,9 @@ with pkgs.lib; ###### interface options = { - + services.fourStore = { - + enable = mkOption { default = false; description = "Whether to enable 4Store RDF database server."; @@ -67,5 +67,5 @@ with pkgs.lib; }; }); - + } diff --git a/modules/services/databases/mysql.nix b/modules/services/databases/mysql.nix index 60410b133b2..65bf77611e0 100644 --- a/modules/services/databases/mysql.nix +++ b/modules/services/databases/mysql.nix @@ -35,9 +35,9 @@ in ###### interface options = { - + services.mysql = { - + enable = mkOption { default = false; description = " @@ -54,7 +54,7 @@ in port = mkOption { default = "3306"; - description = "Port of MySQL"; + description = "Port of MySQL"; }; user = mkOption { @@ -75,8 +75,8 @@ in pidDir = mkOption { default = "/var/run/mysql"; description = "Location of the file which stores the PID of the MySQL server"; - }; - + }; + initialDatabases = mkOption { default = []; description = "List of database names and their initial schemas that should be used to create databases on the first startup of MySQL"; @@ -85,47 +85,47 @@ in { name = "bardatabase"; schema = ./bardatabase.sql; } ]; }; - + initialScript = mkOption { default = null; description = "A file containing SQL statements to be executed on the first startup. Can be used for granting certain permissions on the database"; }; - + rootPassword = mkOption { default = null; - description = "Path to a file containing the root password, modified on the first startup. Not specifying a root password will leave the root password empty."; + description = "Path to a file containing the root password, modified on the first startup. Not specifying a root password will leave the root password empty."; }; - + replication = { role = mkOption { default = "none"; description = "Role of the MySQL server instance. Can be either: master, slave or none"; }; - + serverId = mkOption { default = 1; description = "Id of the MySQL server instance. This number must be unique for each instance"; }; - + masterHost = mkOption { description = "Hostname of the MySQL master server"; }; - + masterUser = mkOption { description = "Username of the MySQL replication user"; }; - + masterPassword = mkOption { description = "Password of the MySQL replication user"; }; - + masterPort = mkOption { default = 3306; description = "Port number on which the MySQL master server runs"; }; }; }; - + }; @@ -159,7 +159,7 @@ in ''; exec = "${mysql}/libexec/mysqld --defaults-extra-file=${myCnf} ${mysqldOptions}"; - + postStart = '' # Wait until the MySQL server is available for use @@ -181,7 +181,7 @@ in then # Create initial databases - ${concatMapStrings (database: + ${concatMapStrings (database: '' if ! test -e "${cfg.dataDir}/${database.name}"; then echo "Creating initial database: ${database.name}" @@ -196,17 +196,17 @@ in fi ) | ${mysql}/bin/mysql -u root -N fi - '') cfg.initialDatabases} - + '') cfg.initialDatabases} + # Execute initial script - + ${optionalString (cfg.initialScript != null) '' cat ${cfg.initialScript} | ${mysql}/bin/mysql -u root -N ''} - + # Change root password - + ${optionalString (cfg.rootPassword != null) '' ( echo "use mysql;" @@ -214,11 +214,11 @@ in echo "flush privileges;" ) | ${mysql}/bin/mysql -u root -N ''} - + rm /tmp/mysql_init fi ''; - + # !!! Need a postStart script to wait until mysqld is ready to # accept connections. diff --git a/modules/services/databases/openldap.nix b/modules/services/databases/openldap.nix index 4186fdc72ac..33a4a25e213 100644 --- a/modules/services/databases/openldap.nix +++ b/modules/services/databases/openldap.nix @@ -16,9 +16,9 @@ in ###### interface options = { - + services.openldap = { - + enable = mkOption { default = false; description = " @@ -33,7 +33,7 @@ in "; }; }; - + }; diff --git a/modules/services/databases/postgresql.nix b/modules/services/databases/postgresql.nix index 8a18020309b..2f2188043aa 100644 --- a/modules/services/databases/postgresql.nix +++ b/modules/services/databases/postgresql.nix @@ -33,46 +33,46 @@ let ident_file = '${pkgs.writeText "pg_ident.conf" cfg.identMap}' log_destination = 'syslog' ${cfg.extraConfig} - ''; + ''; in { ###### interface - + options = { - + services.postgresql = { - + enable = mkOption { default = false; description = '' Whether to run PostgreSQL. ''; }; - + port = mkOption { default = "5432"; description = '' Port for PostgreSQL. ''; }; - + logDir = mkOption { default = "/var/log/postgresql"; description = '' Log directory for PostgreSQL. ''; }; - + dataDir = mkOption { default = "/var/db/postgresql"; description = '' Data directory for PostgreSQL. ''; }; - + authentication = mkOption { default = '' # Generated file; do not edit! @@ -85,22 +85,22 @@ in Defines how users authenticate themselves to the server. ''; }; - + identMap = mkOption { default = ""; description = '' Defines the mapping from system users to database users. ''; }; - + authMethod = mkOption { default = " ident sameuser "; description = '' - How to authorize users. + How to authorize users. Note: ident needs absolute trust to all allowed client hosts. ''; }; - + enableTCPIP = mkOption { default = false; description = '' @@ -122,7 +122,7 @@ in # So a nicer solution was patching postgresql to allow setting the # libdir explicitely. }; - + extraConfig = mkOption { default = ""; description = "Additional text to be appended to postgresql.conf."; @@ -133,7 +133,7 @@ in ###### implementation - + config = mkIf config.services.postgresql.enable { users.extraUsers = singleton @@ -196,5 +196,5 @@ in }; }; - + } diff --git a/modules/services/databases/virtuoso.nix b/modules/services/databases/virtuoso.nix index b41bc0f7ad1..6a29fc13211 100644 --- a/modules/services/databases/virtuoso.nix +++ b/modules/services/databases/virtuoso.nix @@ -10,9 +10,9 @@ with pkgs.lib; ###### interface options = { - + services.virtuoso = { - + enable = mkOption { default = false; description = "Whether to enable Virtuoso Opensource database server."; @@ -94,5 +94,5 @@ with pkgs.lib; ''; }; - + } diff --git a/modules/services/games/ghost-one.nix b/modules/services/games/ghost-one.nix index 2d1195a043d..815118be1c6 100644 --- a/modules/services/games/ghost-one.nix +++ b/modules/services/games/ghost-one.nix @@ -10,7 +10,7 @@ in { ###### interface - + options = { services.ghostOne = { @@ -24,7 +24,7 @@ in check = lang: elem lang [ "English" "Spanish" "Russian" "Serbian" "Turkish" ]; description = "The language of bot messages: English, Spanish, Russian, Serbian or Turkish."; }; - + war3path = mkOption { default = ""; description = '' @@ -102,4 +102,4 @@ in }; -} \ No newline at end of file +} diff --git a/modules/services/hardware/acpid.nix b/modules/services/hardware/acpid.nix index 4be882c1f1e..84680bd3532 100644 --- a/modules/services/hardware/acpid.nix +++ b/modules/services/hardware/acpid.nix @@ -19,22 +19,22 @@ let in pkgs.lib.concatMapStrings f events } ''; - + events = [powerEvent lidEvent acEvent]; - + # Called when the power button is pressed. powerEvent = { name = "power-button"; event = "button/power.*"; - action = + action = '' #! ${pkgs.bash}/bin/sh ${config.services.acpid.powerEventCommands} ''; }; - + # Called when the laptop lid is opened/closed. - lidEvent = + lidEvent = { name = "lid"; event = "button/lid.*"; action = @@ -43,12 +43,12 @@ let ${config.services.acpid.lidEventCommands} ''; }; - + # Called when the AC power is connected or disconnected. acEvent = { name = "ac-power"; event = "ac_adapter.*"; - action = + action = '' #! ${pkgs.bash}/bin/sh ${config.services.acpid.acEventCommands} @@ -62,7 +62,7 @@ in ###### interface options = { - + services.acpid = { enable = mkOption { @@ -86,9 +86,9 @@ in }; }; - + }; - + ###### implementation @@ -101,7 +101,7 @@ in exec = "${pkgs.acpid}/sbin/acpid --foreground --confdir ${acpiConfDir}"; }; - + }; - + } diff --git a/modules/services/hardware/bluetooth.nix b/modules/services/hardware/bluetooth.nix index f32e033081c..06ed9ef70a4 100644 --- a/modules/services/hardware/bluetooth.nix +++ b/modules/services/hardware/bluetooth.nix @@ -12,12 +12,12 @@ with pkgs.lib; default = false; description = "Whether to enable support for Bluetooth."; }; - + }; ###### implementation - + config = mkIf config.hardware.bluetooth.enable { environment.systemPackages = [ pkgs.bluez pkgs.openobex pkgs.obexftp ]; @@ -25,7 +25,7 @@ with pkgs.lib; services.udev.packages = [ pkgs.bluez ]; services.dbus.packages = [ pkgs.bluez ]; - - }; - + + }; + } diff --git a/modules/services/hardware/hal.nix b/modules/services/hardware/hal.nix index cadd1afbe22..f9fb2dfecef 100644 --- a/modules/services/hardware/hal.nix +++ b/modules/services/hardware/hal.nix @@ -20,11 +20,11 @@ in { ###### interface - + options = { - + services.hal = { - + enable = mkOption { default = false; description = '' @@ -40,12 +40,12 @@ in }; }; - + }; ###### implementation - + config = mkIf cfg.enable { environment.systemPackages = [ hal ]; @@ -67,7 +67,7 @@ in jobs.hal = { description = "HAL daemon"; - + startOn = "started dbus" + optionalString config.services.acpid.enable " and started acpid"; environment = @@ -95,7 +95,7 @@ in '' mkdir -m 0755 -p /var/cache/hald mkdir -m 0755 -p /var/run/hald - + rm -f /var/cache/hald/fdi-cache ''; @@ -111,7 +111,7 @@ in services.dbus.enable = true; services.dbus.packages = [hal]; - + }; } diff --git a/modules/services/hardware/pcscd.nix b/modules/services/hardware/pcscd.nix index 6f4e848ee69..9f389efc06d 100644 --- a/modules/services/hardware/pcscd.nix +++ b/modules/services/hardware/pcscd.nix @@ -7,18 +7,18 @@ with pkgs.lib; ###### interface options = { - + services.pcscd = { enable = mkOption { default = false; description = "Whether to enable the PCSC-Lite daemon."; }; - + }; - + }; - + ###### implementation @@ -40,7 +40,7 @@ with pkgs.lib; exec = "${pkgs.pcsclite}/sbin/pcscd"; }; - + }; - + } diff --git a/modules/services/hardware/udev.nix b/modules/services/hardware/udev.nix index 8715c0cb84e..2af4a50e230 100644 --- a/modules/services/hardware/udev.nix +++ b/modules/services/hardware/udev.nix @@ -15,9 +15,9 @@ let }; modprobe = config.system.sbin.modprobe; - + nixosRules = '' - + # Miscellaneous devices. KERNEL=="sonypi", MODE="0666" KERNEL=="kvm", MODE="0666" @@ -26,7 +26,7 @@ let KERNEL=="vboxadd", NAME="vboxadd", OWNER="root", GROUP="root", MODE="0660" KERNEL=="vboxuser", NAME="vboxuser", OWNER="root", GROUP="root", MODE="0666" ''; - + # Perform substitutions in all udev rules files. udevRules = stdenv.mkDerivation { name = "udev-rules"; @@ -40,7 +40,7 @@ let # Set the firmware search path so that the firmware.sh helper # called by 50-firmware.rules works properly. echo 'ENV{FIRMWARE_DIRS}="/root/test-firmware ${toString config.hardware.firmware}"' >> $out/00-path.rules - + # Add the udev rules from other packages. for i in ${toString cfg.packages}; do echo "Adding rules for package $i" @@ -99,7 +99,7 @@ let done # Use the persistent device rules (naming for CD/DVD and - # network devices) stored in + # network devices) stored in # /var/lib/udev/rules.d/70-persistent-{cd,net}.rules. These are # modified by the write_{cd,net}_rules helpers called from # 75-cd-aliases-generator.rules and @@ -129,7 +129,7 @@ in { ###### interface - + options = { boot.hardwareScan = mkOption { @@ -143,7 +143,7 @@ in parameter to the kernel command line. ''; }; - + services.udev = { packages = mkOption { @@ -181,11 +181,11 @@ in }; }; - + hardware.firmware = mkOption { default = []; example = [ "/root/my-firmware" ]; - merge = mergeListOption; + merge = mergeListOption; description = '' List of directories containing firmware files. Such files will be loaded automatically if the kernel asks for them @@ -198,16 +198,16 @@ in pathsToLink = [ "/" ]; }; }; - + }; - + ###### implementation config = { services.udev.extraRules = nixosRules; - + services.udev.packages = [ pkgs.udev extraUdevRules ]; services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.utillinux pkgs.udev ]; diff --git a/modules/services/hardware/udisks.nix b/modules/services/hardware/udisks.nix index 21749da424e..1ba17c589d2 100644 --- a/modules/services/hardware/udisks.nix +++ b/modules/services/hardware/udisks.nix @@ -7,11 +7,11 @@ with pkgs.lib; { ###### interface - + options = { - + services.udisks = { - + enable = mkOption { default = false; description = '' @@ -21,12 +21,12 @@ with pkgs.lib; }; }; - + }; ###### implementation - + config = mkIf config.services.udisks.enable { environment.systemPackages = [ pkgs.udisks ]; diff --git a/modules/services/hardware/upower.nix b/modules/services/hardware/upower.nix index 70f4860304e..1fdaee202d3 100644 --- a/modules/services/hardware/upower.nix +++ b/modules/services/hardware/upower.nix @@ -7,11 +7,11 @@ with pkgs.lib; { ###### interface - + options = { - + services.upower = { - + enable = mkOption { default = false; description = '' @@ -21,12 +21,12 @@ with pkgs.lib; }; }; - + }; ###### implementation - + config = mkIf config.services.upower.enable { environment.systemPackages = [ pkgs.upower ]; diff --git a/modules/services/logging/klogd.nix b/modules/services/logging/klogd.nix index 2b8a6a64d99..2f4bd411e58 100644 --- a/modules/services/logging/klogd.nix +++ b/modules/services/logging/klogd.nix @@ -13,5 +13,5 @@ "${pkgs.sysklogd}/sbin/klogd -c 1 -2 -n " + "-k $(dirname $(readlink -f /var/run/booted-system/kernel))/System.map"; }; - + } diff --git a/modules/services/mail/dovecot.nix b/modules/services/mail/dovecot.nix index a41bd9eaad7..82584ea5de3 100644 --- a/modules/services/mail/dovecot.nix +++ b/modules/services/mail/dovecot.nix @@ -8,9 +8,9 @@ let cfg = config.services.dovecot; - dovecotConf = + dovecotConf = '' - base_dir = /var/run/dovecot/ + base_dir = /var/run/dovecot/ protocols = imap imaps pop3 pop3s '' @@ -33,12 +33,12 @@ let maildir_copy_with_hardlinks = yes auth default { - mechanisms = plain login + mechanisms = plain login userdb passwd { } passdb pam { } - user = root + user = root } auth_debug = yes auth_verbose = yes @@ -47,7 +47,7 @@ let log_path = /var/log/dovecot.log ''; - + confFile = pkgs.writeText "dovecot.conf" dovecotConf; in @@ -57,9 +57,9 @@ in ###### interface options = { - + services.dovecot = { - + enable = mkOption { default = false; description = "Whether to enable the Dovecot POP3/IMAP server."; @@ -69,7 +69,7 @@ in default = "dovecot"; description = "Dovecot user name."; }; - + group = mkOption { default = "dovecot"; description = "Dovecot group name."; @@ -79,22 +79,22 @@ in default = ""; description = "Server certificate"; }; - + sslCACert = mkOption { default = ""; description = "CA certificate used by the server certificate."; }; - + sslServerKey = mkOption { default = ""; description = "Server key."; }; }; - + }; - + ###### implementation config = mkIf config.services.dovecot.enable { @@ -120,13 +120,13 @@ in preStart = '' - ${pkgs.coreutils}/bin/mkdir -p /var/run/dovecot /var/run/dovecot/login + ${pkgs.coreutils}/bin/mkdir -p /var/run/dovecot /var/run/dovecot/login ${pkgs.coreutils}/bin/chown -R ${cfg.user}.${cfg.group} /var/run/dovecot ''; exec = "${pkgs.dovecot}/sbin/dovecot -F -c ${confFile}"; }; - + }; - + } diff --git a/modules/services/mail/freepops.nix b/modules/services/mail/freepops.nix index 9f8b93d3e33..8f6e9382607 100644 --- a/modules/services/mail/freepops.nix +++ b/modules/services/mail/freepops.nix @@ -84,4 +84,4 @@ in ''; }; }; -} \ No newline at end of file +} diff --git a/modules/services/mail/mail.nix b/modules/services/mail/mail.nix index bdf6b28ffbc..bad0b22625d 100644 --- a/modules/services/mail/mail.nix +++ b/modules/services/mail/mail.nix @@ -7,9 +7,9 @@ with pkgs.lib; ###### interface options = { - + services.mail = { - + sendmailSetuidWrapper = mkOption { default = null; description = '' diff --git a/modules/services/mail/postfix.nix b/modules/services/mail/postfix.nix index 71f3a89f19c..13a02386886 100644 --- a/modules/services/mail/postfix.nix +++ b/modules/services/mail/postfix.nix @@ -11,7 +11,7 @@ let group = cfg.group; setgidGroup = cfg.setgidGroup; - mainCf = + mainCf = '' queue_directory = /var/postfix/queue command_directory = ${pkgs.postfix}/sbin @@ -30,7 +30,7 @@ let '' else if cfg.networksStyle != "" then '' - mynetworks_style = ${cfg.networksStyle} + mynetworks_style = ${cfg.networksStyle} '' else # Postfix default is subnet, but let's play safe @@ -54,12 +54,12 @@ let '' + '' local_recipient_maps = - - relayhost = ${if cfg.lookupMX || cfg.relayHost == "" then - cfg.relayHost - else + + relayhost = ${if cfg.lookupMX || cfg.relayHost == "" then + cfg.relayHost + else "[" + cfg.relayHost + "]"} - + alias_maps = hash:/var/postfix/conf/aliases mail_spool_directory = /var/spool/mail/ @@ -78,13 +78,13 @@ let smtpd_tls_cert_file = ${cfg.sslCert} smtpd_tls_key_file = ${cfg.sslKey} - smtpd_use_tls = yes + smtpd_use_tls = yes recipientDelimiter = ${cfg.recipientDelimiter} '' + cfg.extraConfig; - aliases = + aliases = optionalString (cfg.postmasterAlias != "") '' postmaster: ${cfg.postmasterAlias} '' @@ -96,7 +96,7 @@ let aliasesFile = pkgs.writeText "postfix-aliases" aliases; mainCfFile = pkgs.writeText "postfix-main.cf" mainCf; - + in { @@ -104,9 +104,9 @@ in ###### interface options = { - + services.postfix = { - + enable = mkOption { default = false; description = "Whether to run the Postfix mail server."; @@ -116,44 +116,44 @@ in default = true; description = "Whether to set the system sendmail to postfix's."; }; - + user = mkOption { default = "postfix"; description = "What to call the Postfix user (must be used only for postfix)."; }; - + group = mkOption { default = "postfix"; description = "What to call the Postfix group (must be used only for postfix)."; }; - + setgidGroup = mkOption { default = "postdrop"; description = " - How to call postfix setgid group (for postdrop). Should + How to call postfix setgid group (for postdrop). Should be uniquely used group. "; }; - + networks = mkOption { default = null; example = ["192.168.0.1/24"]; description = " - Net masks for trusted - allowed to relay mail to third parties - - hosts. Leave empty to use mynetworks_style configuration or use + Net masks for trusted - allowed to relay mail to third parties - + hosts. Leave empty to use mynetworks_style configuration or use default (localhost-only). "; }; - + networksStyle = mkOption { default = ""; description = " Name of standard way of trusted network specification to use, - leave blank if you specify it explicitly or if you want to use + leave blank if you specify it explicitly or if you want to use default (localhost-only). "; }; - + hostname = mkOption { default = ""; description =" @@ -161,65 +161,65 @@ in It should be FQDN. "; }; - + domain = mkOption { default = ""; description =" Domain to use. Leave blank to use hostname minus first component. "; }; - + origin = mkOption { default = ""; description =" Origin to use in outgoing e-mail. Leave blank to use hostname. "; }; - + destination = mkOption { default = null; example = ["localhost"]; description = " - Full (!) list of domains we deliver locally. Leave blank for + Full (!) list of domains we deliver locally. Leave blank for acceptable Postfix default. "; }; - + relayDomains = mkOption { default = null; example = ["localdomain"]; description = " - List of domains we agree to relay to. Default is the same as + List of domains we agree to relay to. Default is the same as destination. "; }; - + relayHost = mkOption { default = ""; description = " Mail relay for outbound mail. "; }; - + lookupMX = mkOption { default = false; description = " Whether relay specified is just domain whose MX must be used. "; }; - + postmasterAlias = mkOption { default = "root"; description = "Who should receive postmaster e-mail."; }; - + rootAlias = mkOption { default = ""; description = " Who should receive root e-mail. Blank for no redirection. "; }; - + extraAliases = mkOption { default = ""; description = " @@ -238,12 +238,12 @@ in default = ""; description = "SSL certificate to use."; }; - + sslCACert = mkOption { default = ""; description = "SSL certificate of CA."; }; - + sslKey = mkOption { default = ""; description = "SSL key to use."; @@ -293,19 +293,19 @@ in }; users.extraGroups = - [ { name = group; + [ { name = group; gid = config.ids.gids.postfix; } - { name = setgidGroup; + { name = setgidGroup; gid = config.ids.gids.postdrop; } ]; jobs.postfix = - # I copy _lots_ of shipped configuration filed + # I copy _lots_ of shipped configuration filed # that can be left as is. I am afraid the exact - # will list slightly change in next Postfix - # release, so listing them all one-by-one in an + # will list slightly change in next Postfix + # release, so listing them all one-by-one in an # accurate way is unlikely to be better. { description = "Postfix mail server"; @@ -330,20 +330,20 @@ in if ! [ -d /var/spool/postfix ]; then ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue fi - - ${pkgs.coreutils}/bin/chown -R ${user}.${group} /var/postfix - ${pkgs.coreutils}/bin/chown -R ${user}.${setgidGroup} /var/postfix/queue - ${pkgs.coreutils}/bin/chmod -R ug+rwX /var/postfix/queue + + ${pkgs.coreutils}/bin/chown -R ${user}.${group} /var/postfix + ${pkgs.coreutils}/bin/chown -R ${user}.${setgidGroup} /var/postfix/queue + ${pkgs.coreutils}/bin/chmod -R ug+rwX /var/postfix/queue ${pkgs.coreutils}/bin/chown root.root /var/spool/mail ${pkgs.coreutils}/bin/chmod a+rwxt /var/spool/mail - + ln -sf ${pkgs.postfix}/share/postfix/conf/* /var/postfix/conf ln -sf ${aliasesFile} /var/postfix/conf/aliases ln -sf ${mainCfFile} /var/postfix/conf/main.cf ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases - + exec ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start ''; # */ diff --git a/modules/services/misc/autofs.nix b/modules/services/misc/autofs.nix index ea7a1437928..37ba3bf309c 100644 --- a/modules/services/misc/autofs.nix +++ b/modules/services/misc/autofs.nix @@ -17,9 +17,9 @@ in ###### interface options = { - + services.autofs = { - + enable = mkOption { default = false; description = " @@ -97,7 +97,7 @@ in pkgs.lib.concatMapStrings (module : "modprobe ${module} || true\n") (["autofs4"] ++ cfg.kernelModules); - preStop = + preStop = '' set -e; while :; do pkill -TERM automount; sleep 1; done ''; @@ -125,7 +125,7 @@ in exec ${pkgs.autofs5}/sbin/automount ${if cfg.debug then "-d" else ""} -f -t ${builtins.toString cfg.timeout} "${autoMaster}" ${if cfg.debug then "-l7" else ""} ''; }; - + }; - + } diff --git a/modules/services/misc/disnix.nix b/modules/services/misc/disnix.nix index d0ef5d34a64..1cb538f6a61 100644 --- a/modules/services/misc/disnix.nix +++ b/modules/services/misc/disnix.nix @@ -6,7 +6,7 @@ with pkgs.lib; let cfg = config.services.disnix; - + disnix_activation_scripts = pkgs.disnix_activation_scripts.override (origArgs: { enableApacheWebApplication = config.services.httpd.enable; enableAxis2WebService = config.services.tomcat.axis2.enable; @@ -21,47 +21,47 @@ in { ###### interface - + options = { - + services.disnix = { - + enable = mkOption { default = false; description = "Whether to enable Disnix"; }; - + useWebServiceInterface = mkOption { default = false; description = "Whether to enable the DisnixWebService interface running on Apache Tomcat"; }; - + publishInfrastructure = { enable = mkOption { default = false; description = "Whether to publish capabilities/properties of this machine in as attributes in the infrastructure option"; }; - + enableAuthentication = mkOption { default = false; description = "Whether to publish authentication credentials through the infrastructure attribute (not recommended in combination with Avahi)"; }; - }; - + }; + infrastructure = mkOption { default = {}; description = "List of name value pairs containing properties for the infrastructure model"; }; - + publishAvahi = mkOption { default = false; description = "Whether to publish capabilities/properties as a Disnix service through Avahi"; }; }; - + }; - + ###### implementation @@ -84,7 +84,7 @@ in { name = "disnix"; gid = config.ids.gids.disnix; }; - + services.disnix.infrastructure = optionalAttrs (cfg.publishInfrastructure.enable) ( { hostname = config.networking.hostName; @@ -97,12 +97,12 @@ in // optionalAttrs (config.services.tomcat.enable) { tomcatPort = 8080; } // optionalAttrs (config.services.svnserve.enable) { svnBaseDir = config.services.svnserve.svnBaseDir; } // optionalAttrs (cfg.publishInfrastructure.enableAuthentication) ( - optionalAttrs (config.services.mysql.enable) { mysqlUsername = "root"; mysqlPassword = builtins.readFile config.services.mysql.rootPassword; }) + optionalAttrs (config.services.mysql.enable) { mysqlUsername = "root"; mysqlPassword = builtins.readFile config.services.mysql.rootPassword; }) ) ; - + services.disnix.publishInfrastructure.enable = cfg.publishAvahi; - + jobs = { disnix = { description = "Disnix server"; @@ -124,9 +124,9 @@ in } // optionalAttrs cfg.publishAvahi { disnixAvahi = { description = "Disnix Avahi publisher"; - + startOn = "started avahi-daemon"; - + exec = '' ${pkgs.avahi}/bin/avahi-publish-service disnix-${config.networking.hostName} _disnix._tcp 22 \ diff --git a/modules/services/misc/felix.nix b/modules/services/misc/felix.nix index f05abc38f08..2da50fc8595 100644 --- a/modules/services/misc/felix.nix +++ b/modules/services/misc/felix.nix @@ -12,16 +12,16 @@ in { ###### interface - + options = { - + services.felix = { - + enable = mkOption { default = false; description = "Whether to enable the Apache Felix OSGi service"; }; - + bundles = mkOption { default = [ pkgs.felix_remoteshell ]; description = "List of bundles that should be activated on startup"; @@ -30,17 +30,17 @@ in user = mkOption { default = "osgi"; description = "User account under which Apache Felix runs."; - }; + }; group = mkOption { default = "osgi"; description = "Group account under which Apache Felix runs."; - }; - + }; + }; - + }; - + ###### implementation @@ -49,7 +49,7 @@ in { name = "osgi"; gid = config.ids.gids.osgi; }; - + users.extraUsers = singleton { name = "osgi"; uid = config.ids.uids.osgi; @@ -60,16 +60,16 @@ in jobs.felix = { description = "Felix server"; - preStart = + preStart = '' # Initialise felix instance on first startup if [ ! -d /var/felix ] then # Symlink system files - + mkdir -p /var/felix chown ${cfg.user}:${cfg.group} /var/felix - + for i in ${pkgs.felix}/* do if [ "$i" != "${pkgs.felix}/bundle" ] @@ -77,11 +77,11 @@ in ln -sfn $i /var/felix/$(basename $i) fi done - + # Symlink bundles mkdir -p /var/felix/bundle chown ${cfg.user}:${cfg.group} /var/felix/bundle - + for i in ${pkgs.felix}/bundle/* ${toString cfg.bundles} do if [ -f $i ] @@ -97,7 +97,7 @@ in done fi ''; - + script = '' cd /var/felix diff --git a/modules/services/misc/folding-at-home.nix b/modules/services/misc/folding-at-home.nix index 06223bc56e0..9f4c4645279 100644 --- a/modules/services/misc/folding-at-home.nix +++ b/modules/services/misc/folding-at-home.nix @@ -7,9 +7,9 @@ let in { ###### interface - + options = { - + services.foldingAtHome = { enable = mkOption { @@ -29,7 +29,7 @@ in { config = mkOption { default = ""; description = '' - Extra configuration. Contents will be added verbatim to the + Extra configuration. Contents will be added verbatim to the configuration file. ''; }; @@ -71,4 +71,4 @@ in { }; -} \ No newline at end of file +} diff --git a/modules/services/misc/gpsd.nix b/modules/services/misc/gpsd.nix index 0d12bbc29f3..bc1d1f4575a 100644 --- a/modules/services/misc/gpsd.nix +++ b/modules/services/misc/gpsd.nix @@ -7,7 +7,7 @@ let uid = config.ids.uids.gpsd; gid = config.ids.gids.gpsd; cfg = config.services.gpsd; - + in { @@ -15,7 +15,7 @@ in ###### interface options = { - + services.gpsd = { enable = mkOption { @@ -70,9 +70,9 @@ in ###### implementation - + config = mkIf cfg.enable { - + users.extraUsers = singleton { name = "gpsd"; inherit uid; @@ -100,5 +100,5 @@ in }; }; - + } diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index 11a7aa19f23..221ad6e1f54 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -5,7 +5,7 @@ with pkgs.lib; let inherit (config.environment) nix; - + makeNixBuildUser = nr: { name = "nixbld${toString nr}"; description = "Nix build user ${toString nr}"; @@ -34,7 +34,7 @@ in This option specifies the Nix package instance to use throughout the system. "; }; - + nix = { maxJobs = mkOption { @@ -76,10 +76,10 @@ in gc-keep-derivations = true "; description = " - This option allows to append lines to nix.conf. + This option allows to append lines to nix.conf. "; }; - + distributedBuilds = mkOption { default = false; description = " @@ -97,8 +97,8 @@ in manualNixMachines = mkOption { default = false; description = " - Whether to manually manage the list of buildmachines used in distributed - builds in /etc/nix.machines. + Whether to manually manage the list of buildmachines used in distributed + builds in /etc/nix.machines. "; }; @@ -113,7 +113,7 @@ in daemonIONiceLevel = mkOption { default = 7; description = " - Nix daemon process I/O priority. This priority propagates to build processes. + Nix daemon process I/O priority. This priority propagates to build processes. 0 is the default Unix process I/O priority, 7 is the lowest. "; }; @@ -155,11 +155,11 @@ in on the remote machine. "; }; - + proxy = mkOption { default = ""; description = " - This option specifies the proxy to use for fetchurl. The real effect + This option specifies the proxy to use for fetchurl. The real effect is just exporting http_proxy, https_proxy and ftp_proxy with that value. "; @@ -208,13 +208,13 @@ in # in `build-chroot-dirs' - otherwise any builder that uses # /bin/sh won't work. binshDeps = pkgs.writeReferencesToFile config.system.build.binsh; - + # Likewise, if chroots are turned on, we need Nix's own # closure in the chroot. Otherwise nix-channel and nix-env # won't work because the dependencies of its builders (like # coreutils and Perl) aren't visible. Sigh. nixDeps = pkgs.writeReferencesToFile config.environment.nix; - in + in pkgs.runCommand "nix.conf" {extraOptions = config.nix.extraOptions; } '' extraPaths=$(for i in $(cat ${binshDeps} ${nixDeps}); do if test -d $i; then echo $i; fi; done) cat > $out < /dev/null 2>&1 ''; - extraConfig = + extraConfig = '' limit nofile 4096 4096 ''; @@ -269,7 +269,7 @@ in '' # Set up the environment variables for running Nix. ${config.nix.envVars} - + # Set up secure multi-user builds: non-root users build through the # Nix daemon. if test "$USER" != root; then diff --git a/modules/services/misc/nixos-manual.nix b/modules/services/misc/nixos-manual.nix index f463a91998e..7853baf3afa 100644 --- a/modules/services/misc/nixos-manual.nix +++ b/modules/services/misc/nixos-manual.nix @@ -15,7 +15,7 @@ let inherit (cfg) revision; inherit pkgs options; }; - + in { @@ -73,7 +73,7 @@ in boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"]; jobs = mkIf cfg.showManual - { nixosManual = + { nixosManual = { name = "nixos-manual"; description = "NixOS manual"; @@ -88,7 +88,7 @@ in }; }; - services.ttyBackgrounds.specificThemes = mkIf cfg.showManual + services.ttyBackgrounds.specificThemes = mkIf cfg.showManual [ { tty = "tty${cfg.ttyNumber}"; theme = pkgs.themes "green"; } @@ -96,7 +96,7 @@ in services.mingetty.helpLine = mkIf cfg.showManual "\nPress for the NixOS manual."; - + }; } diff --git a/modules/services/misc/rogue.nix b/modules/services/misc/rogue.nix index 8760ce12510..c313de956fc 100644 --- a/modules/services/misc/rogue.nix +++ b/modules/services/misc/rogue.nix @@ -10,12 +10,12 @@ let cfg = config.services.rogue; in - + { ###### interface options = { - + services.rogue.enable = mkOption { default = false; description = '' @@ -33,13 +33,13 @@ in }; - + ###### implementation config = mkIf cfg.enable { boot.extraTTYs = [ cfg.tty ]; - + jobs.rogue = { description = "Rogue dungeon crawling game"; @@ -56,5 +56,5 @@ in }; }; - + } diff --git a/modules/services/misc/svnserve.nix b/modules/services/misc/svnserve.nix index c1acf5723d8..b0806d14738 100644 --- a/modules/services/misc/svnserve.nix +++ b/modules/services/misc/svnserve.nix @@ -6,30 +6,30 @@ with pkgs.lib; let cfg = config.services.svnserve; - + in { ###### interface - + options = { - + services.svnserve = { - + enable = mkOption { default = false; description = "Whether to enable svnserve to serve Subversion repositories through the SVN protocol."; }; - + svnBaseDir = mkOption { default = "/repos"; description = "Base directory from which Subversion repositories are accessed."; }; }; - + }; - + ###### implementation @@ -37,9 +37,9 @@ in jobs.svnserve = { startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; - + preStart = "mkdir -p ${cfg.svnBaseDir}"; - + exec = "${pkgs.subversion}/bin/svnserve -r ${cfg.svnBaseDir} -d --foreground --pid-file=/var/run/svnserve.pid"; }; }; diff --git a/modules/services/misc/synergy.nix b/modules/services/misc/synergy.nix index 5d21e281b75..667d0c6de97 100644 --- a/modules/services/misc/synergy.nix +++ b/modules/services/misc/synergy.nix @@ -13,7 +13,7 @@ in ###### interface options = { - + services.synergy = { # !!! All these option descriptions needs to be cleaned up. @@ -27,13 +27,13 @@ in }; screenName = mkOption { default = ""; - description = " + description = " use screen-name instead the hostname to identify ourselfs to the server. "; }; serverAddress = mkOption { - description = " + description = " The server address is of the form: [hostname][:port]. The hostname must be the address or hostname of the server. The port overrides the default port, 24800. @@ -56,7 +56,7 @@ in }; screenName = mkOption { default = ""; - description = " + description = " use screen-name instead the hostname to identify this screen in the configuration. "; @@ -76,9 +76,9 @@ in config = { jobs = - + optionalAttrs cfgC.enable - { synergyClient = + { synergyClient = { name = "synergy-client"; description = "Synergy client"; @@ -92,9 +92,9 @@ in ''; }; } - + // optionalAttrs cfgS.enable - { synergyServer = + { synergyServer = { name = "synergy-server"; description = "Synergy server"; @@ -122,7 +122,7 @@ section: screens win: end section: aliases - laptop: + laptop: 192.168.5.5 dm: 192.168.5.78 diff --git a/modules/services/misc/virtualbox.nix b/modules/services/misc/virtualbox.nix index 00b81b2f383..e1384323453 100644 --- a/modules/services/misc/virtualbox.nix +++ b/modules/services/misc/virtualbox.nix @@ -12,20 +12,20 @@ in { ###### interface - + options = { - + services.virtualbox = { - + enable = mkOption { default = false; description = "Whether to enable the VirtualBox service and other guest additions."; - }; + }; }; - + }; - + ###### implementation @@ -34,10 +34,10 @@ in environment.systemPackages = [ ]; boot.extraModulePackages = [ pkgs.linuxPackages.virtualboxGuestAdditions ]; - + jobs.virtualbox = { description = "VirtualBox service"; - + startOn = "started udev"; exec = "${pkgs.linuxPackages.virtualboxGuestAdditions}/sbin/VBoxService"; diff --git a/modules/services/monitoring/monit.nix b/modules/services/monitoring/monit.nix index 40ad8456d7c..2acc51c64a6 100644 --- a/modules/services/monitoring/monit.nix +++ b/modules/services/monitoring/monit.nix @@ -1,7 +1,7 @@ # Monit system watcher # http://mmonit.org/monit/ -{config, pkgs, ...}: +{config, pkgs, ...}: let inherit (pkgs.lib) mkOption mkIf; in @@ -25,9 +25,9 @@ in }; }; }; - + config = mkIf config.services.monit.enable { - + environment.etc = [ { source = pkgs.writeTextFile { @@ -38,10 +38,10 @@ in mode = "0400"; } ]; - + jobs.monit = { description = "Monit system watcher"; - + startOn = config.services.monit.startOn; exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf"; diff --git a/modules/services/monitoring/nagios/default.nix b/modules/services/monitoring/nagios/default.nix index 6b1b3163d26..6d2fe3f2ace 100644 --- a/modules/services/monitoring/nagios/default.nix +++ b/modules/services/monitoring/nagios/default.nix @@ -48,7 +48,7 @@ let illegal_macro_output_chars=`~$&|'"<> retain_state_information=1 ''; # " - + # Plain configuration for the Nagios web-interface with no # authentication. nagiosCGICfgFile = pkgs.writeText "nagios.cgi.conf" @@ -83,12 +83,12 @@ let ''; in - + { ###### interface options = { - + services.nagios = { enable = mkOption { @@ -141,7 +141,7 @@ in ###### implementation config = mkIf cfg.enable { - + users.extraUsers = singleton { name = nagiosUser; uid = config.ids.uids.nagios; @@ -190,7 +190,7 @@ in elsePart = ""; }; }; - + }; } diff --git a/modules/services/monitoring/systemhealth.nix b/modules/services/monitoring/systemhealth.nix index 85f297cfb71..61e6a38fc9a 100644 --- a/modules/services/monitoring/systemhealth.nix +++ b/modules/services/monitoring/systemhealth.nix @@ -118,7 +118,7 @@ in { function = f: { extraConfig = '' Alias ${cfg.urlPrefix} ${htmlDir} - + Order allow,deny Allow from all diff --git a/modules/services/monitoring/ups.nix b/modules/services/monitoring/ups.nix index b10788c96c4..2874bbf2087 100644 --- a/modules/services/monitoring/ups.nix +++ b/modules/services/monitoring/ups.nix @@ -119,7 +119,7 @@ in description = '' The MODE determines which part of the NUT is to be started, and which configuration files must be modified. - + The values of MODE can be: - none: NUT is not configured, or use the Integrated Power @@ -263,7 +263,7 @@ in description = "UPnP A/V Media Server user"; } ]; - + users.extraGroups = [ { name = "nut"; gid = 84; diff --git a/modules/services/monitoring/zabbix-agent.nix b/modules/services/monitoring/zabbix-agent.nix index 8f598b8a7a1..4d6b267c1a8 100644 --- a/modules/services/monitoring/zabbix-agent.nix +++ b/modules/services/monitoring/zabbix-agent.nix @@ -18,7 +18,7 @@ let Server = ${cfg.server} LogFile = ${logDir}/zabbix_agentd - + PidFile = ${pidFile} StartAgents = 1 @@ -27,13 +27,13 @@ let ''; in - + { ###### interface options = { - + services.zabbixAgent = { enable = mkOption { @@ -61,7 +61,7 @@ in }; }; - + ###### implementation @@ -103,7 +103,7 @@ in ${pkgs.zabbix.agent}/sbin/zabbix_agentd --config ${configFile} 100>${stateDir}/dummy2 wait "$pid" ''; - + postStop = '' pid=$(cat ${pidFile} 2> /dev/null || true) diff --git a/modules/services/monitoring/zabbix-server.nix b/modules/services/monitoring/zabbix-server.nix index 9f875d455de..b5af5a2e7bb 100644 --- a/modules/services/monitoring/zabbix-server.nix +++ b/modules/services/monitoring/zabbix-server.nix @@ -18,7 +18,7 @@ let configFile = pkgs.writeText "zabbix_server.conf" '' LogFile = ${logDir}/zabbix_server - + PidFile = ${pidFile} DBHost = ${cfg.dbServer} @@ -33,13 +33,13 @@ let ''; in - + { ###### interface options = { - + services.zabbixServer.enable = mkOption { default = false; description = '' @@ -119,7 +119,7 @@ in while ${pkgs.procps}/bin/pkill -u zabbix zabbix_server; do true; done ''; }; - + }; } diff --git a/modules/services/network-filesystems/nfs-kernel.nix b/modules/services/network-filesystems/nfs-kernel.nix index bc828d5bbb8..c475f694499 100644 --- a/modules/services/network-filesystems/nfs-kernel.nix +++ b/modules/services/network-filesystems/nfs-kernel.nix @@ -17,7 +17,7 @@ in ###### interface options = { - + services.nfsKernel = { client.enable = mkOption { @@ -53,7 +53,7 @@ in 8. ''; }; - + nproc = mkOption { default = 8; description = '' @@ -66,7 +66,7 @@ in description = "Whether to create the mount points in the exports file at startup time."; }; }; - + }; }; @@ -89,9 +89,9 @@ in jobs = optionalAttrs cfg.server.enable - { nfs_kernel_exports = + { nfs_kernel_exports = { name = "nfs-kernel-exports"; - + description = "Kernel NFS server"; startOn = "started network-interfaces"; @@ -100,7 +100,7 @@ in '' export PATH=${pkgs.nfsUtils}/sbin:$PATH mkdir -p /var/lib/nfs - + ${config.system.sbin.modprobe}/sbin/modprobe nfsd || true ${pkgs.sysvtools}/bin/mountpoint -q /proc/fs/nfsd \ @@ -122,9 +122,9 @@ in ''; }; } - + // optionalAttrs cfg.server.enable - { nfs_kernel_nfsd = + { nfs_kernel_nfsd = { name = "nfs-kernel-nfsd"; description = "Kernel NFS server"; @@ -132,7 +132,7 @@ in startOn = "started nfs-kernel-exports and started nfs-kernel-mountd and started nfs-kernel-statd and started portmap"; stopOn = "stopping nfs-kernel-exports"; - preStart = + preStart = '' # Create a state directory required by NFSv4. mkdir -p /var/lib/nfs/v4recovery @@ -162,7 +162,7 @@ in } // optionalAttrs (cfg.client.enable || cfg.server.enable) - { nfs_kernel_statd = + { nfs_kernel_statd = { name = "nfs-kernel-statd"; description = "Kernel NFS server - Network Status Monitor"; @@ -171,7 +171,7 @@ in stopOn = "never"; preStart = - '' + '' mkdir -p /var/lib/nfs mkdir -p /var/lib/nfs/sm mkdir -p /var/lib/nfs/sm.bak @@ -184,7 +184,7 @@ in postStart = "${pkgs.nfsUtils}/sbin/sm-notify -d"; }; }; - + }; - + } diff --git a/modules/services/network-filesystems/samba.nix b/modules/services/network-filesystems/samba.nix index 7ad597a9fa2..7461d12d78b 100644 --- a/modules/services/network-filesystems/samba.nix +++ b/modules/services/network-filesystems/samba.nix @@ -5,13 +5,13 @@ with pkgs.lib; let cfg = config.services.samba; - + user = "smbguest"; group = "smbguest"; logDir = "/var/log/samba"; privateDir = "/var/samba/private"; - + inherit (pkgs) samba; setupScript = @@ -72,7 +72,7 @@ let TZ = config.time.timeZone; LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive"; }; - + daemonType = "fork"; exec = "${samba}/sbin/${appName} ${args}"; @@ -87,7 +87,7 @@ in options = { # !!! clean up the descriptions. - + services.samba = { enable = mkOption { @@ -176,7 +176,7 @@ in }; }; - + ###### implementation @@ -218,5 +218,5 @@ in jobs.winbindd = daemonJob "winbindd" "-D"; }; - + } diff --git a/modules/services/networking/amuled.nix b/modules/services/networking/amuled.nix index f499e72c0d2..658d16af006 100644 --- a/modules/services/networking/amuled.nix +++ b/modules/services/networking/amuled.nix @@ -12,7 +12,7 @@ in ###### interface options = { - + services.amule = { enable = mkOption { @@ -39,7 +39,7 @@ in }; }; - + ###### implementation @@ -67,5 +67,5 @@ in }; }; - + } diff --git a/modules/services/networking/avahi-daemon.nix b/modules/services/networking/avahi-daemon.nix index 0ca9869db0b..81432d34864 100644 --- a/modules/services/networking/avahi-daemon.nix +++ b/modules/services/networking/avahi-daemon.nix @@ -30,7 +30,7 @@ in ###### interface options = { - + services.avahi = { enable = mkOption { @@ -83,11 +83,11 @@ in domain by transparently querying the Avahi daemon. ''; }; - + }; - + }; - + ###### implementation diff --git a/modules/services/networking/bind.nix b/modules/services/networking/bind.nix index c93c2a9b00e..54eb5e08e9b 100644 --- a/modules/services/networking/bind.nix +++ b/modules/services/networking/bind.nix @@ -5,7 +5,7 @@ with pkgs.lib; let startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces"; - + cfg = config.services.bind; confFile = pkgs.writeText "named.conf" @@ -26,7 +26,7 @@ let ${ concatMapStrings ({ name, file, master ? true, slaves ? [], masters ? [] }: - '' + '' zone "${name}" { type ${if master then "master" else "slave"}; file "${file}"; @@ -56,35 +56,35 @@ in ###### interface options = { - + services.bind = { - + enable = mkOption { default = false; description = " Whether to enable BIND domain name server. "; }; - + cacheNetworks = mkOption { default = ["127.0.0.0/24"]; description = " What networks are allowed to use us as a resolver. "; }; - + blockedNetworks = mkOption { default = []; description = " What networks are just blocked. "; }; - + zones = mkOption { default = []; description = " List of zones we claim authority over. - master=false means slave server; slaves means addresses + master=false means slave server; slaves means addresses who may request zone transfer. "; example = [{ @@ -95,11 +95,11 @@ in slaves = []; }]; }; - + }; }; - + ###### implementation @@ -117,5 +117,5 @@ in }; }; - + } diff --git a/modules/services/networking/bitlbee.nix b/modules/services/networking/bitlbee.nix index 573feda5462..8fd79cb00f3 100644 --- a/modules/services/networking/bitlbee.nix +++ b/modules/services/networking/bitlbee.nix @@ -5,9 +5,9 @@ with pkgs.lib; let bitlbeeUid = config.ids.uids.bitlbee; - + inherit (config.services.bitlbee) portNumber interface; - + in { @@ -15,7 +15,7 @@ in ###### interface options = { - + services.bitlbee = { enable = mkOption { @@ -46,7 +46,7 @@ in }; }; - + ###### implementation @@ -58,7 +58,7 @@ in description = "BitlBee user"; home = "/var/empty"; }; - + users.extraGroups = singleton { name = "bitlbee"; gid = config.ids.gids.bitlbee; @@ -88,5 +88,5 @@ in environment.systemPackages = [ pkgs.bitlbee ]; }; - + } diff --git a/modules/services/networking/ddclient.nix b/modules/services/networking/ddclient.nix index 575386c8579..a0523919ef4 100644 --- a/modules/services/networking/ddclient.nix +++ b/modules/services/networking/ddclient.nix @@ -33,9 +33,9 @@ in { ###### interface - + options = { - + services.ddclient = { enable = mkOption { @@ -102,7 +102,7 @@ in config = mkIf config.services.ddclient.enable { environment.systemPackages = [ ddclient ]; - + users.extraUsers = singleton { name = ddclientUser; uid = config.ids.uids.ddclient; @@ -128,5 +128,5 @@ in }; }; - + } diff --git a/modules/services/networking/dhclient.nix b/modules/services/networking/dhclient.nix index 2acef81e1e5..0a353ae1eab 100644 --- a/modules/services/networking/dhclient.nix +++ b/modules/services/networking/dhclient.nix @@ -8,7 +8,7 @@ let # Don't start dhclient on explicitly configured interfaces or on # interfaces that are part of a bridge. - ignoredInterfaces = + ignoredInterfaces = map (i: i.name) (lib.filter (i: i ? ipAddress && i.ipAddress != "" ) config.networking.interfaces) ++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bridges)); @@ -29,7 +29,7 @@ let # anything ever again ("couldn't resolve ..., giving up on # it"), so we silently lose time synchronisation. ${config.system.build.upstart}/sbin/initctl stop ntpd - + ${config.system.build.upstart}/sbin/initctl emit -n ip-up fi @@ -37,7 +37,7 @@ let ${config.system.build.upstart}/sbin/initctl emit -n ip-down fi ''; - + in { @@ -45,7 +45,7 @@ in ###### interface options = { - + networking.useDHCP = mkOption { default = true; merge = mergeEnableOption; @@ -55,15 +55,15 @@ in configured. "; }; - + }; ###### implementation - + config = mkIf config.networking.useDHCP { - jobs.dhclient = + jobs.dhclient = { startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; @@ -83,7 +83,7 @@ in # (1), i.e. Ethernet. Ignore peth* devices; on Xen, # they're renamed physical Ethernet cards used for # bridging. Likewise for vif* and tap* (Xen) and - # virbr* and vnet* (libvirt). + # virbr* and vnet* (libvirt). if [ "$(cat /sys/class/net/$i/type)" = 1 ]; then if ! for j in ${toString ignoredInterfaces}; do echo $j; done | grep -F -x -q "$i" && ! echo "$i" | grep -x -q "peth.*\|vif.*\|tap.*\|virbr.*\|vnet.*"; @@ -121,7 +121,7 @@ in initctl restart dhclient ''; - }; - + }; + } diff --git a/modules/services/networking/dnsmasq.nix b/modules/services/networking/dnsmasq.nix index 6ff9e05f4d6..389d5c22e82 100644 --- a/modules/services/networking/dnsmasq.nix +++ b/modules/services/networking/dnsmasq.nix @@ -13,9 +13,9 @@ in { ###### interface - + options = { - + services.dnsmasq = { enable = mkOption { @@ -41,7 +41,7 @@ in ###### implementation config = mkIf config.services.dnsmasq.enable { - + jobs.dnsmasq = { description = "dnsmasq daemon"; @@ -51,7 +51,7 @@ in exec = "${dnsmasq}/bin/dnsmasq -R ${serversParam}"; }; - + }; - + } diff --git a/modules/services/networking/firewall.nix b/modules/services/networking/firewall.nix index b4083d3c9e2..64cfcef124a 100644 --- a/modules/services/networking/firewall.nix +++ b/modules/services/networking/firewall.nix @@ -5,7 +5,7 @@ uses several chains: - ‘nixos-fw-input’ is the main chain for input packet processing. - + - ‘nixos-fw-log-refuse’ and ‘nixos-fw-refuse’ are called for refused packets. (The former jumps to the latter after logging the packet.) If you want additional logging, or want to accept @@ -17,7 +17,7 @@ can insert rules at the start of this chain. */ - + { config, pkgs, ... }: @@ -44,7 +44,7 @@ in ###### interface options = { - + networking.firewall.enable = mkOption { default = false; description = @@ -55,7 +55,7 @@ in forwarding. ''; }; - + networking.firewall.logRefusedConnections = mkOption { default = true; description = @@ -63,7 +63,7 @@ in Whether to log rejected or dropped incoming connections. ''; }; - + networking.firewall.logRefusedPackets = mkOption { default = false; description = @@ -95,7 +95,7 @@ in port scanning somewhat easier. ''; }; - + networking.firewall.allowedTCPPorts = mkOption { default = []; example = [ 22 80 ]; @@ -106,7 +106,7 @@ in accepted. ''; }; - + networking.firewall.allowedUDPPorts = mkOption { default = []; example = [ 53 ]; @@ -116,7 +116,7 @@ in List of open UDP ports. ''; }; - + networking.firewall.allowPing = mkOption { default = false; type = types.bool; @@ -128,7 +128,7 @@ in less effective. ''; }; - + networking.firewall.extraCommands = mkOption { default = ""; example = "iptables -A INPUT -p icmp -j ACCEPT"; @@ -140,7 +140,7 @@ in to allow packets that would otherwise be refused. ''; }; - + }; @@ -184,7 +184,7 @@ in # The "nixos-fw-refuse" chain rejects or drops packets. ip46tables -N nixos-fw-refuse - + ${if cfg.rejectPackets then '' # Send a reset for existing TCP connections that we've # somehow forgotten about. Send ICMP "port unreachable" @@ -219,7 +219,7 @@ in # The "nixos-fw" chain does the actual work. ip46tables -N nixos-fw - + # Accept all traffic on the loopback interface. ip46tables -A nixos-fw -i lo -j nixos-fw-accept diff --git a/modules/services/networking/git-daemon.nix b/modules/services/networking/git-daemon.nix index b3841d4f074..a7c7c206198 100644 --- a/modules/services/networking/git-daemon.nix +++ b/modules/services/networking/git-daemon.nix @@ -9,7 +9,7 @@ in { ###### interface - + options = { services.gitDaemon = { @@ -18,7 +18,7 @@ in description = '' Enable Git daemon, which allows public hosting of git repositories without any access controls. This is mostly intended for read-only access. - + You can allow write access by setting daemon.receivepack configuration item of the repository to true. This is solely meant for a closed LAN setting where everybody is friendly. @@ -109,4 +109,4 @@ in }; -} \ No newline at end of file +} diff --git a/modules/services/networking/gnunet.nix b/modules/services/networking/gnunet.nix index a717ff47f02..a86c3999c2c 100644 --- a/modules/services/networking/gnunet.nix +++ b/modules/services/networking/gnunet.nix @@ -48,9 +48,9 @@ in ###### interface options = { - + services.gnunet = { - + enable = mkOption { default = false; description = '' diff --git a/modules/services/networking/gvpe.nix b/modules/services/networking/gvpe.nix index 102de2bca2d..594a2e80f34 100644 --- a/modules/services/networking/gvpe.nix +++ b/modules/services/networking/gvpe.nix @@ -1,32 +1,32 @@ # GNU Virtual Private Ethernet -{config, pkgs, ...}: +{config, pkgs, ...}: -let +let inherit (pkgs.lib) mkOption mkIf; cfg = config.services.gvpe; - finalConfig = if cfg.configFile != null then + finalConfig = if cfg.configFile != null then cfg.configFile else if cfg.configText != null then pkgs.writeTextFile { name = "gvpe.conf"; text = cfg.configText; } - else + else throw "You must either specify contents of the config file or the config file itself for GVPE"; - ifupScript = if cfg.ipAddress == null || cfg.subnet == null then - throw "Specify IP address and subnet (with mask) for GVPE" - else if cfg.nodename == null then - throw "You must set node name for GVPE" + ifupScript = if cfg.ipAddress == null || cfg.subnet == null then + throw "Specify IP address and subnet (with mask) for GVPE" + else if cfg.nodename == null then + throw "You must set node name for GVPE" else - (pkgs.writeTextFile { + (pkgs.writeTextFile { name = "gvpe-if-up"; text = '' #! /bin/sh - + export PATH=$PATH:${pkgs.iproute}/sbin ip link set $IFNAME up @@ -80,7 +80,7 @@ in udp-port = 655 mtu = 1480 ifname = vpn0 - + node = alpha hostname = alpha.example.org connect = always @@ -124,7 +124,7 @@ in config = mkIf cfg.enable { jobs.gvpe = { description = "GNU Virtual Private Ethernet node"; - + inherit startOn stopOn; preStart = '' diff --git a/modules/services/networking/gw6c/default.nix b/modules/services/networking/gw6c/default.nix index a566679d789..72f72d4c005 100644 --- a/modules/services/networking/gw6c/default.nix +++ b/modules/services/networking/gw6c/default.nix @@ -44,9 +44,9 @@ in ###### interface options = { - + services.gw6c = { - + enable = mkOption { default = false; description = " @@ -57,7 +57,7 @@ in autorun = mkOption { default = true; description = " - Switch to false to create upstart-job and configuration, + Switch to false to create upstart-job and configuration, but not run it automatically "; }; @@ -109,23 +109,23 @@ in }; }; - + security.seccureKeys = { # !!! It's not clear to me (ED) what additional security this # provides. Passwords shouldn't be in configuration.nix, # period. You could just place the password in # /var/blah/password or whatever. - + public = mkOption { default = /var/elliptic-keys/public; description = " Public key. Make it path argument, so it is copied into store and - hashed. + hashed. The key is used to encrypt Gateway 6 configuration in store, as it - contains a password for external service. Unfortunately, - derivation file should be protected by other means. For example, + contains a password for external service. Unfortunately, + derivation file should be protected by other means. For example, nix-http-export.cgi will happily export any non-derivation path, but not a derivation. "; @@ -141,7 +141,7 @@ in }; }; - + ###### implementation @@ -149,7 +149,7 @@ in jobs.gw6c = { description = "Gateway6 client"; - + startOn = if cfg.autorun then "started network-interfaces" else ""; stopOn = "stopping network-interfaces"; diff --git a/modules/services/networking/ifplugd.nix b/modules/services/networking/ifplugd.nix index 6ec71849ca3..e4e4fd9216a 100644 --- a/modules/services/networking/ifplugd.nix +++ b/modules/services/networking/ifplugd.nix @@ -20,14 +20,14 @@ let fi ''; -in +in { ###### interface options = { - + networking.interfaceMonitor.enable = mkOption { default = false; description = " @@ -46,7 +46,7 @@ in plugged in or unplugged. "; }; - + }; @@ -69,7 +69,7 @@ in }; environment.systemPackages = [ifplugd]; - + }; } diff --git a/modules/services/networking/ircd-hybrid/default.nix b/modules/services/networking/ircd-hybrid/default.nix index c4bf1878acf..d28e856eabf 100644 --- a/modules/services/networking/ircd-hybrid/default.nix +++ b/modules/services/networking/ircd-hybrid/default.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.services.ircdHybrid; - + ircdService = pkgs.stdenv.mkDerivation rec { name = "ircd-hybrid-service"; scripts = [ "=>/bin" ./control.in ]; @@ -17,7 +17,7 @@ let inherit (cfg) serverName sid description adminEmail extraPort; - cryptoSettings = + cryptoSettings = (optionalString (cfg.rsaKey != null) "rsa_private_key_file = \"${cfg.rsaKey}\";\n") + (optionalString (cfg.certificate != null) "ssl_certificate_file = \"${cfg.certificate}\";\n"); @@ -35,7 +35,7 @@ in ###### interface options = { - + services.ircdHybrid = { enable = mkOption { @@ -70,7 +70,7 @@ in default = null; example = /root/certificates/irc.key; description = " - IRCD server RSA key. + IRCD server RSA key. "; }; @@ -86,7 +86,7 @@ in default = ""; example = ""; description = " - IRCD server administrator e-mail. + IRCD server administrator e-mail. "; }; @@ -115,7 +115,7 @@ in config = mkIf config.services.ircdHybrid.enable { users.extraUsers = singleton - { name = "ircd"; + { name = "ircd"; description = "IRCD owner"; }; diff --git a/modules/services/networking/nat.nix b/modules/services/networking/nat.nix index 50b2590b3be..c51eeb54be7 100644 --- a/modules/services/networking/nat.nix +++ b/modules/services/networking/nat.nix @@ -15,7 +15,7 @@ in ###### interface options = { - + networking.nat.enable = mkOption { default = false; description = @@ -23,7 +23,7 @@ in Whether to enable Network Address Translation (NAT). ''; }; - + networking.nat.internalIPs = mkOption { example = "192.168.1.0/24"; description = @@ -33,7 +33,7 @@ in interface will be rewritten. ''; }; - + networking.nat.externalInterface = mkOption { example = "eth1"; description = @@ -41,7 +41,7 @@ in The name of the external network interface. ''; }; - + networking.nat.externalIP = mkOption { default = ""; example = "203.0.113.123"; @@ -53,7 +53,7 @@ in used. ''; }; - + }; diff --git a/modules/services/networking/ntpd.nix b/modules/services/networking/ntpd.nix index f0b96951eb1..6e3040a2ae1 100644 --- a/modules/services/networking/ntpd.nix +++ b/modules/services/networking/ntpd.nix @@ -30,9 +30,9 @@ in { ###### interface - + options = { - + services.ntp = { enable = mkOption { @@ -62,7 +62,7 @@ in ###### implementation config = mkIf config.services.ntp.enable { - + users.extraUsers = singleton { name = ntpUser; uid = config.ids.uids.ntp; @@ -93,7 +93,7 @@ in exec = "${ntp}/bin/ntpd -g -n ${ntpFlags}"; }; - + }; - + } diff --git a/modules/services/networking/openfire.nix b/modules/services/networking/openfire.nix index 02e6b4c9aaa..7ac53067f77 100644 --- a/modules/services/networking/openfire.nix +++ b/modules/services/networking/openfire.nix @@ -5,12 +5,12 @@ with pkgs.lib; let inherit (pkgs) jre openfire coreutils which gnugrep gawk gnused; - + startDependency = if config.services.openfire.usePostgreSQL then "postgresql" else if config.services.gw6c.enable then "gw6c" else "network-interfaces"; - + in { @@ -18,16 +18,16 @@ in ###### interface options = { - + services.openfire = { - + enable = mkOption { default = false; description = " Whether to enable OpenFire XMPP server. "; }; - + usePostgreSQL = mkOption { default = true; description = " @@ -56,8 +56,8 @@ in '' export PATH=${jre}/bin:${openfire}/bin:${coreutils}/bin:${which}/bin:${gnugrep}/bin:${gawk}/bin:${gnused}/bin export HOME=/tmp - mkdir /var/log/openfire || true - mkdir /etc/openfire || true + mkdir /var/log/openfire || true + mkdir /etc/openfire || true for i in ${openfire}/conf.inst/*; do if ! test -f /etc/openfire/$(basename $i); then cp $i /etc/openfire/ @@ -68,5 +68,5 @@ in }; }); - + } diff --git a/modules/services/networking/openvpn.nix b/modules/services/networking/openvpn.nix index 772a9509064..bec5d7b8107 100644 --- a/modules/services/networking/openvpn.nix +++ b/modules/services/networking/openvpn.nix @@ -75,15 +75,15 @@ let }; in - + { ###### interface options = { - + services.openvpn = { - + enable = mkOption { default = false; description = "Whether to enable OpenVPN."; @@ -98,7 +98,7 @@ in mostSimple = { config = '' # Most simple configuration: http://openvpn.net/index.php/documentation/miscellaneous/static-key-mini-howto.html. - # server : + # server : dev tun ifconfig 10.8.0.1 10.8.0.2 secret static.key @@ -132,7 +132,7 @@ in Each instance will result in a new job file. Additionally you can specify the up/ down scripts by setting - the up down properties. + the up down properties. Config lines up=/nix/store/xxx-up-script down=... will be appended to your configuration file automatically @@ -161,5 +161,5 @@ in environment.systemPackages = [ openvpn ]; }; - + } diff --git a/modules/services/networking/portmap.nix b/modules/services/networking/portmap.nix index 9c0d559f867..0b03c6ccdb4 100644 --- a/modules/services/networking/portmap.nix +++ b/modules/services/networking/portmap.nix @@ -8,7 +8,7 @@ let gid = config.ids.gids.portmap; portmap = pkgs.portmap.override { daemonUID = uid; daemonGID = gid; }; - + in { @@ -16,9 +16,9 @@ in ###### interface options = { - + services.portmap = { - + enable = mkOption { default = false; description = '' @@ -45,7 +45,7 @@ in }; }; - + ###### implementation diff --git a/modules/services/networking/privoxy.nix b/modules/services/networking/privoxy.nix index a63a32996eb..443328f67b0 100644 --- a/modules/services/networking/privoxy.nix +++ b/modules/services/networking/privoxy.nix @@ -28,9 +28,9 @@ in { ###### interface - + options = { - + services.privoxy = { enable = mkOption { @@ -69,7 +69,7 @@ in config = mkIf config.services.privoxy.enable { environment.systemPackages = [ privoxy ]; - + users.extraUsers = singleton { name = privoxyUser; uid = config.ids.uids.privoxy; @@ -95,5 +95,5 @@ in }; }; - + } diff --git a/modules/services/networking/quassel.nix b/modules/services/networking/quassel.nix index 916694c6910..d5c38cfd048 100644 --- a/modules/services/networking/quassel.nix +++ b/modules/services/networking/quassel.nix @@ -13,7 +13,7 @@ in ###### interface options = { - + services.quassel = { enable = mkOption { @@ -56,7 +56,7 @@ in }; }; - + ###### implementation @@ -66,7 +66,7 @@ in { name = "quassel"; description = "Quassel IRC client daemon"; }]; - + jobs.quassel = { description = "Quassel IRC client daemon"; @@ -86,5 +86,5 @@ in }; }; - + } diff --git a/modules/services/networking/radvd.nix b/modules/services/networking/radvd.nix index 4da60525e38..8d586ce6e46 100644 --- a/modules/services/networking/radvd.nix +++ b/modules/services/networking/radvd.nix @@ -17,7 +17,7 @@ in ###### interface options = { - + services.radvd.enable = mkOption { default = false; description = @@ -53,10 +53,10 @@ in config = mkIf cfg.enable { environment.systemPackages = [ pkgs.radvd ]; - + jobs.radvd = { description = "IPv6 Router Advertisement Daemon"; - + startOn = "started network-interfaces"; preStart = @@ -66,12 +66,12 @@ in # necessarily for all interfaces). echo 1 > /proc/sys/net/ipv6/conf/all/forwarding ''; - + exec = "${pkgs.radvd}/sbin/radvd -m syslog -s -C ${confFile}"; daemonType = "fork"; }; }; - -} \ No newline at end of file + +} diff --git a/modules/services/networking/rdnssd.nix b/modules/services/networking/rdnssd.nix index 11017b8e250..f797206ad5c 100644 --- a/modules/services/networking/rdnssd.nix +++ b/modules/services/networking/rdnssd.nix @@ -10,7 +10,7 @@ with pkgs.lib; ###### interface options = { - + services.rdnssd.enable = mkOption { default = false; #default = config.networking.enableIPv6; @@ -32,7 +32,7 @@ with pkgs.lib; jobs.rdnssd = { description = "RDNSS daemon"; - + # Start before the network interfaces are brought up so that # the daemon receives RDNSS advertisements from the kernel. startOn = "starting network-interfaces"; @@ -44,5 +44,5 @@ with pkgs.lib; }; }; - + } diff --git a/modules/services/networking/sabnzbd.nix b/modules/services/networking/sabnzbd.nix index 06c528188b6..8816ac0d2f8 100644 --- a/modules/services/networking/sabnzbd.nix +++ b/modules/services/networking/sabnzbd.nix @@ -2,7 +2,7 @@ with pkgs.lib; -let +let cfg = config.services.sabnzbd; inherit (pkgs) sabnzbd; @@ -25,7 +25,7 @@ in }; }; }; - + ###### implementation diff --git a/modules/services/networking/ssh/lshd.nix b/modules/services/networking/ssh/lshd.nix index 63943990f61..d32fabbde24 100644 --- a/modules/services/networking/ssh/lshd.nix +++ b/modules/services/networking/ssh/lshd.nix @@ -2,7 +2,7 @@ with pkgs.lib; -let +let inherit (pkgs) lsh; @@ -15,7 +15,7 @@ in ###### interface options = { - + services.lshd = { enable = mkOption { @@ -106,7 +106,7 @@ in an executable implementing it. ''; }; - + }; }; @@ -169,7 +169,7 @@ in subsystems)} ''; }; - + }; - + } diff --git a/modules/services/networking/tftpd.nix b/modules/services/networking/tftpd.nix index 002fc991555..37935496c59 100644 --- a/modules/services/networking/tftpd.nix +++ b/modules/services/networking/tftpd.nix @@ -5,7 +5,7 @@ with pkgs.lib; { ###### interface - + options = { services.tftpd.enable = mkOption { diff --git a/modules/services/networking/vsftpd.nix b/modules/services/networking/vsftpd.nix index 837f44c4213..1b2432401de 100644 --- a/modules/services/networking/vsftpd.nix +++ b/modules/services/networking/vsftpd.nix @@ -2,10 +2,10 @@ with pkgs.lib; -let +let cfg = config.services.vsftpd; - + inherit (pkgs) vsftpd; yesNoOption = p : name : @@ -18,9 +18,9 @@ in ###### interface options = { - + services.vsftpd = { - + enable = mkOption { default = false; description = "Whether to enable the vsftpd FTP server."; @@ -72,9 +72,9 @@ in }; }; - + }; - + ###### implementation @@ -133,5 +133,5 @@ in }; }; - + } diff --git a/modules/services/networking/wakeonlan.nix b/modules/services/networking/wakeonlan.nix index 936936d2948..1fc54986b16 100644 --- a/modules/services/networking/wakeonlan.nix +++ b/modules/services/networking/wakeonlan.nix @@ -14,7 +14,7 @@ let if method == "magicpacket" then "wol g" else if method == "password" then "wol s so ${passwordParameter password}" else throw "Wake-On-Lan method not supported"; - + line = { interface, method ? "magicpacket", password ? "" }: '' ${ethtool} -s ${interface} ${methodParameter {inherit method password;}} ''; @@ -26,7 +26,7 @@ in { ###### interface - + options = { services.wakeonlan.interfaces = mkOption { diff --git a/modules/services/networking/wicd.nix b/modules/services/networking/wicd.nix index b26511bcb52..8e012273216 100644 --- a/modules/services/networking/wicd.nix +++ b/modules/services/networking/wicd.nix @@ -7,7 +7,7 @@ with pkgs.lib; ###### interface options = { - + networking.wicd.enable = mkOption { default = false; description = '' @@ -20,12 +20,12 @@ with pkgs.lib; ###### implementation - + config = mkIf config.networking.wicd.enable { environment.systemPackages = [pkgs.wicd]; - jobs.wicd = + jobs.wicd = { startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; @@ -35,7 +35,7 @@ with pkgs.lib; services.dbus.enable = true; services.dbus.packages = [pkgs.wicd]; - + }; } diff --git a/modules/services/networking/xinetd.nix b/modules/services/networking/xinetd.nix index 5b74d7e420a..0bd6052c125 100644 --- a/modules/services/networking/xinetd.nix +++ b/modules/services/networking/xinetd.nix @@ -2,10 +2,10 @@ with pkgs.lib; -let +let cfg = config.services.xinetd; - + inherit (pkgs) xinetd; configFile = pkgs.writeText "xinetd.conf" @@ -16,7 +16,7 @@ let log_on_failure = HOST log_on_success = PID HOST DURATION EXIT } - + ${concatMapStrings makeService cfg.services} ''; @@ -35,15 +35,15 @@ let ${optionalString (srv.serverArgs != "") "server_args = ${srv.serverArgs}"} } ''; - + in - + { ###### interface - + options = { - + services.xinetd.enable = mkOption { default = false; description = '' @@ -58,7 +58,7 @@ in ''; type = types.list types.optionSet; - + options = { name = mkOption { @@ -120,7 +120,7 @@ in }; }; - + ###### implementation diff --git a/modules/services/printing/cupsd.nix b/modules/services/printing/cupsd.nix index 632bdbae90d..81ab8a1531e 100644 --- a/modules/services/printing/cupsd.nix +++ b/modules/services/printing/cupsd.nix @@ -143,7 +143,7 @@ in }; services.printing.drivers = [ pkgs.cups pkgs.cups_pdf_filter pkgs.ghostscript additionalBackends ]; - + services.printing.cupsdConf = '' LogLevel info diff --git a/modules/services/scheduling/atd.nix b/modules/services/scheduling/atd.nix index 8f6d1667bdb..8213f4b3667 100644 --- a/modules/services/scheduling/atd.nix +++ b/modules/services/scheduling/atd.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.services.atd; - + inherit (pkgs) at; in @@ -15,7 +15,7 @@ in ###### interface options = { - + services.atd.enable = mkOption { default = true; description = '' @@ -26,14 +26,14 @@ in services.atd.allowEveryone = mkOption { default = false; description = '' - Whether to make /var/spool/at{jobs,spool} writeable + Whether to make /var/spool/at{jobs,spool} writeable by everyone (and sticky). This is normally not needed since the `at' commands are setuid/setgid `atd'. ''; }; - + }; - + ###### implementation diff --git a/modules/services/scheduling/cron.nix b/modules/services/scheduling/cron.nix index 555cde92876..9a81eb6e72c 100644 --- a/modules/services/scheduling/cron.nix +++ b/modules/services/scheduling/cron.nix @@ -22,7 +22,7 @@ let # should have sendmail in this path. sendmailPath = "/var/setuid-wrappers/sendmail"; }; - + in { @@ -30,7 +30,7 @@ in ###### interface options = { - + services.cron = { enable = mkOption { @@ -66,7 +66,7 @@ in }; }; - + }; @@ -89,7 +89,7 @@ in { description = "Cron daemon"; startOn = "startup"; - + # Needed to interpret times in the local timezone. environment = { TZ = config.time.timeZone; }; @@ -108,5 +108,5 @@ in }; }; - + } diff --git a/modules/services/scheduling/fcron.nix b/modules/services/scheduling/fcron.nix index 4521b3c5760..bf70bb65727 100644 --- a/modules/services/scheduling/fcron.nix +++ b/modules/services/scheduling/fcron.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.services.fcron; - + queuelen = if cfg.queuelen == "" then "" else "-q ${toString cfg.queuelen}"; systemCronJobs = @@ -28,38 +28,38 @@ in { ###### interface - + options = { - + services.fcron = { - + enable = mkOption { default = false; description = "Whether to enable the `fcron' daemon."; }; - + allow = mkOption { default = [ "all" ]; description = '' Users allowed to use fcrontab and fcrondyn (one name per line, "all" for everyone). ''; }; - + deny = mkOption { default = []; description = "Users forbidden from using fcron."; }; - + maxSerialJobs = mkOption { default = 1; description = "Maximum number of serial jobs which can run simultaneously."; }; - + queuelen = mkOption { default = ""; description = "Number of jobs the serial queue and the lavg queue can contain - empty to net set this number (-q)"; }; - + systab = mkOption { default = ""; description = ''The "system" crontab contents.''; diff --git a/modules/services/security/tor.nix b/modules/services/security/tor.nix index 6e1b2838ead..6582ba70253 100644 --- a/modules/services/security/tor.nix +++ b/modules/services/security/tor.nix @@ -22,15 +22,15 @@ in { ###### interface - + options = { - + services.tor = { config = mkOption { default = ""; description = '' - Extra configuration. Contents will be added verbatim to the + Extra configuration. Contents will be added verbatim to the configuration file. ''; }; @@ -49,7 +49,7 @@ in default = "127.0.0.1:9050"; example = "192.168.0.1:9100"; description = '' - Bind to this address to listen for connections from Socks-speaking + Bind to this address to listen for connections from Socks-speaking applications. ''; }; @@ -70,9 +70,9 @@ in default = true; description = '' Whether to enable a special instance of privoxy dedicated to Tor. - To have anonymity, protocols need to be scrubbed of identifying + To have anonymity, protocols need to be scrubbed of identifying information. - Most people using Tor want to anonymize their web traffic, so by + Most people using Tor want to anonymize their web traffic, so by default we enable an special instance of privoxy specifically for Tor. However, if you are only going to use Tor only for other kinds of @@ -84,9 +84,9 @@ in default = "127.0.0.1:8118"; description = '' Address that Tor's instance of privoxy is listening to. - *This does not configure the standard NixOS instance of privoxy.* - This is for Tor connections only! - See services.privoxy.listenAddress to configure the standard NixOS + *This does not configure the standard NixOS instance of privoxy.* + This is for Tor connections only! + See services.privoxy.listenAddress to configure the standard NixOS instace of privoxy. ''; }; @@ -94,11 +94,11 @@ in config = mkOption { default = ""; description = '' - Extra configuration for Tor's instance of privoxy. Contents will be + Extra configuration for Tor's instance of privoxy. Contents will be added verbatim to the configuration file. - *This does not configure the standard NixOS instance of privoxy.* - This is for Tor connections only! - See services.privoxy.extraConfig to configure the standard NixOS + *This does not configure the standard NixOS instance of privoxy.* + This is for Tor connections only! + See services.privoxy.extraConfig to configure the standard NixOS instace of privoxy. ''; }; @@ -107,7 +107,7 @@ in }; - relay = { + relay = { enable = mkOption { default = false; @@ -246,7 +246,7 @@ in torPrivoxy = { name = "tor-privoxy"; startOn = "starting tor"; - stopOn = "stopping tor"; + stopOn = "stopping tor"; preStart = '' mkdir -m 0755 -p ${privoxyDir} @@ -275,7 +275,7 @@ in ${if cfg.relay.isExit then opt "ExitPolicy" cfg.relay.exitPolicy else "ExitPolicy reject *:*"} ${if cfg.relay.isBridge then "BridgeRelay 1" else ""} ''; - + services.tor.client.privoxy.config = '' # Generally, this file goes in /etc/privoxy/config # @@ -287,14 +287,14 @@ in actionsfile default.action # Main actions file actionsfile user.action # User customizations filterfile default.filter - + # Don't log interesting things, only startup messages, warnings and errors logfile logfile #jarfile jarfile #debug 0 # show each GET/POST/CONNECT request debug 4096 # Startup banner and warnings debug 8192 # Errors - *we highly recommended enabling this* - + user-manual ${privoxy}/doc/privoxy/user-manual listen-address ${cfg.client.privoxy.listenAddress} toggle 1 @@ -302,10 +302,10 @@ in enable-edit-actions 0 enable-remote-http-toggle 0 buffer-limit 4096 - + # Extra config goes here ''; - + }); - + } diff --git a/modules/services/security/torsocks.nix b/modules/services/security/torsocks.nix index 5257327b384..e56bd012d04 100644 --- a/modules/services/security/torsocks.nix +++ b/modules/services/security/torsocks.nix @@ -19,9 +19,9 @@ in { ###### interface - + options = { - + services.tor.torsocks = { enable = mkOption { diff --git a/modules/services/system/dbus.nix b/modules/services/system/dbus.nix index 248b29a3dd5..4f6d577e936 100644 --- a/modules/services/system/dbus.nix +++ b/modules/services/system/dbus.nix @@ -14,13 +14,13 @@ let name = "dbus-conf"; buildCommand = '' ensureDir $out - + cp -v ${pkgs.dbus_daemon}/etc/dbus-1/system.conf $out/system.conf # !!! Hm, these `sed' calls are rather error-prone... # Tell the daemon where the setuid wrapper around - # dbus-daemon-launch-helper lives. + # dbus-daemon-launch-helper lives. sed -i $out/system.conf \ -e 's|.*/libexec/dbus-daemon-launch-helper|${config.security.wrapperDir}/dbus-daemon-launch-helper|' @@ -31,7 +31,7 @@ let -e 's|system.d|${systemIncludeDirs}|' cp ${pkgs.dbus_daemon}/etc/dbus-1/session.conf $out/session.conf - + # Add the services and session.d directories to the session bus # search path. sed -i $out/session.conf \ @@ -63,7 +63,7 @@ in ###### interface options = { - + services.dbus = { enable = mkOption { @@ -87,7 +87,7 @@ in }; }; - + }; @@ -125,7 +125,7 @@ in mkdir -m 0755 -p /var/lib/dbus ${pkgs.dbus_tools}/bin/dbus-uuidgen --ensure - + rm -f ${homeDir}/pid ''; @@ -160,7 +160,7 @@ in ]; environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ]; - + }; - + } diff --git a/modules/services/system/kerberos.nix b/modules/services/system/kerberos.nix index 4ca9a0169bf..2a47b904589 100644 --- a/modules/services/system/kerberos.nix +++ b/modules/services/system/kerberos.nix @@ -12,9 +12,9 @@ in { ###### interface - + options = { - + services.kerberos_server = { enable = mkOption { @@ -32,9 +32,9 @@ in ###### implementation config = mkIf config.services.kerberos_server.enable { - + environment.systemPackages = [ heimdal ]; - + services.xinetd.enable = true; services.xinetd.services = pkgs.lib.singleton { name = "kerberos-adm"; @@ -67,5 +67,5 @@ in exec = "${heimdal}/sbin/kpasswdd"; }; }; - + } diff --git a/modules/services/system/nscd.nix b/modules/services/system/nscd.nix index ede6c4213db..971b73706ae 100644 --- a/modules/services/system/nscd.nix +++ b/modules/services/system/nscd.nix @@ -7,7 +7,7 @@ let nssModulesPath = config.system.nssModules.path; inherit (pkgs.lib) singleton; - + in { @@ -32,7 +32,7 @@ in ###### implementation config = mkIf config.services.nscd.enable { - + users.extraUsers = singleton { name = "nscd"; uid = config.ids.uids.nscd; @@ -45,7 +45,7 @@ in startOn = "startup"; environment = { LD_LIBRARY_PATH = nssModulesPath; }; - + preStart = '' mkdir -m 0755 -p /var/run/nscd diff --git a/modules/services/system/uptimed.nix b/modules/services/system/uptimed.nix index fd4c1652bd3..51874cfc0e5 100644 --- a/modules/services/system/uptimed.nix +++ b/modules/services/system/uptimed.nix @@ -19,9 +19,9 @@ in { ###### interface - + options = { - + services.uptimed = { enable = mkOption { @@ -39,9 +39,9 @@ in ###### implementation config = mkIf config.services.uptimed.enable { - + environment.systemPackages = [ uptimed ]; - + users.extraUsers = singleton { name = uptimedUser; uid = config.ids.uids.uptimed; @@ -69,7 +69,7 @@ in exec = "${uptimed}/sbin/uptimed ${uptimedFlags}"; }; - + }; - + } diff --git a/modules/services/ttys/gpm.nix b/modules/services/ttys/gpm.nix index 256fe8d2380..6a425cf327f 100644 --- a/modules/services/ttys/gpm.nix +++ b/modules/services/ttys/gpm.nix @@ -7,15 +7,15 @@ let cfg = config.services.gpm; in - + { ###### interface options = { - + services.gpm = { - + enable = mkOption { default = false; description = '' @@ -23,16 +23,16 @@ in which enables mouse support in virtual consoles. ''; }; - + protocol = mkOption { default = "ps/2"; description = "Mouse protocol to use."; }; }; - + }; - + ###### implementation @@ -47,5 +47,5 @@ in }; }; - + } diff --git a/modules/services/ttys/mingetty.nix b/modules/services/ttys/mingetty.nix index e924d38dd60..1de075588e7 100644 --- a/modules/services/ttys/mingetty.nix +++ b/modules/services/ttys/mingetty.nix @@ -7,7 +7,7 @@ with pkgs.lib; ###### interface options = { - + services.mingetty = { ttys = mkOption { @@ -47,7 +47,7 @@ with pkgs.lib; }; }; - + }; @@ -55,25 +55,25 @@ with pkgs.lib; config = { - # Generate a separate job for each tty. + # Generate a separate job for each tty. jobs = listToAttrs (map (tty: nameValuePair tty { - + startOn = "started udev and filesystem"; exec = "${pkgs.mingetty}/sbin/mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}"; - + }) config.services.mingetty.ttys); environment.etc = singleton { # Friendly greeting on the virtual consoles. source = pkgs.writeText "issue" '' - + ${config.services.mingetty.greetingLine} ${config.services.mingetty.helpLine} - + ''; target = "issue"; }; }; - + } diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index c6cbac5e611..a7e0472cd3f 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -5,7 +5,7 @@ with pkgs.lib; let mainCfg = config.services.httpd; - + startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces"; httpd = pkgs.apacheHttpd; @@ -16,7 +16,7 @@ let extraForeignModules = filter builtins.isAttrs extraModules; extraApacheModules = filter (x: !(builtins.isAttrs x)) extraModules; # I'd prefer using builtins.isString here, but doesn't exist yet - + makeServerInfo = cfg: { # Canonical name must not include a trailing slash. canonicalName = @@ -40,7 +40,7 @@ let }; vhosts = let - makeVirtualHost = cfgIn: + makeVirtualHost = cfgIn: let # Fill in defaults for missing options. cfg = addDefaultOptionValues vhostOptions cfgIn; @@ -49,11 +49,11 @@ let allHosts = [mainCfg] ++ vhosts; - + callSubservices = serverInfo: defs: let f = svc: - let + let svcFunction = if svc ? function then svc.function else import "${./.}/${if svc ? serviceType then svc.serviceType else svc.serviceName}.nix"; @@ -77,7 +77,7 @@ let in map f defs; - # !!! callSubservices is expensive + # !!! callSubservices is expensive subservicesFor = cfg: callSubservices (makeServerInfo cfg) cfg.extraSubservices; mainSubservices = subservicesFor mainCfg; @@ -91,10 +91,10 @@ let enableSSL = any (vhost: vhost.enableSSL) allHosts; - + # Names of modules from ${httpd}/modules that we want to load. - apacheModules = + apacheModules = [ # HTTP authentication mechanisms: basic and digest. "auth_basic" "auth_digest" @@ -110,10 +110,10 @@ let "mime" "dav" "status" "autoindex" "asis" "info" "cgi" "dav_fs" "vhost_alias" "negotiation" "dir" "imagemap" "actions" "speling" "userdir" "alias" "rewrite" "proxy" "proxy_http" - ] + ] ++ optional enableSSL "ssl" ++ extraApacheModules; - + loggingConf = '' ErrorLog ${mainCfg.logDir}/error_log @@ -208,7 +208,7 @@ let SSLCertificateFile ${cfg.sslServerCert} SSLCertificateKeyFile ${cfg.sslServerKey} '' else ""} - + ${if cfg.enableSSL then '' SSLEngine on '' else if enableSSL then /* i.e., SSL is enabled for some host, but not this one */ @@ -230,10 +230,10 @@ let ${if isMainServer || cfg.documentRoot != null then documentRootConf else ""} ${if cfg.enableUserDir then '' - + UserDir public_html UserDir disabled root - + AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec @@ -246,7 +246,7 @@ let Deny from all - + '' else ""} ${if cfg.globalRedirect != "" then '' @@ -278,9 +278,9 @@ let ${cfg.extraConfig} ''; - + httpdConf = pkgs.writeText "httpd.conf" '' - + ServerRoot ${httpd} PidFile ${mainCfg.stateDir}/httpd.pid @@ -305,7 +305,7 @@ let concatMap (svc: svc.extraModulesPre) allSubservices ++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules ++ optional enablePHP { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; } - ++ concatMap (svc: svc.extraModules) allSubservices + ++ concatMap (svc: svc.extraModules) allSubservices ++ extraForeignModules; in concatMapStrings load allModules } @@ -325,7 +325,7 @@ let Include ${httpd}/conf/extra/httpd-autoindex.conf Include ${httpd}/conf/extra/httpd-multilang-errordoc.conf Include ${httpd}/conf/extra/httpd-languages.conf - + ${if enableSSL then sslConf else ""} # Fascist default - deny access to everything. @@ -346,7 +346,7 @@ let # Generate directives for the main server. ${perServerConf true mainCfg} - + # Always enable virtual hosts; it doesn't seem to hurt. ${let ports = map getPort allHosts; @@ -387,9 +387,9 @@ in ###### interface options = { - + services.httpd = { - + enable = mkOption { default = false; description = " @@ -609,5 +609,5 @@ in }; }; - + } diff --git a/modules/services/web-servers/apache-httpd/mediawiki.nix b/modules/services/web-servers/apache-httpd/mediawiki.nix index c5c892825f4..d45d477b671 100644 --- a/modules/services/web-servers/apache-httpd/mediawiki.nix +++ b/modules/services/web-servers/apache-httpd/mediawiki.nix @@ -5,13 +5,13 @@ with pkgs.lib; let src_clean_skin = pkgs.fetchurl { - url = "http://lastlog.de/misc/clean-1.01.tar.gz"; - sha256 = "5fb1736b64b33ca3429d035f1358cf8217da2d02019d8a80b14c7985367f659f"; + url = "http://lastlog.de/misc/clean-1.01.tar.gz"; + sha256 = "5fb1736b64b33ca3429d035f1358cf8217da2d02019d8a80b14c7985367f659f"; }; src_nixos_skin = pkgs.fetchurl { - url = "http://lastlog.de/misc/nixos-1.0.tar.gz"; - sha256 = "413b0f451bde81ac2dd0bede17dd088f9abcd0f3cea1722279311ca648a855cf"; + url = "http://lastlog.de/misc/nixos-1.0.tar.gz"; + sha256 = "413b0f451bde81ac2dd0bede17dd088f9abcd0f3cea1722279311ca648a855cf"; }; mediawikiConfig = pkgs.writeText "LocalSettings.php" @@ -83,7 +83,7 @@ let # Unpack Mediawiki and put the config file in its root directory. mediawikiRoot = pkgs.stdenv.mkDerivation rec { name= "mediawiki-1.15.5"; - + src = pkgs.fetchurl { url = "http://download.wikimedia.org/mediawiki/1.15/${name}.tar.gz"; sha256 = "1d8afbdh3lsg54b69mnh6a47psb3lg978xpp277qs08yz15cjf7q"; @@ -116,7 +116,7 @@ let --add-flags ${mediawikiRoot}/maintenance/$i done ''; - + in { @@ -132,7 +132,7 @@ in Options -Indexes ''} - + Alias ${config.urlPrefix} ${mediawikiRoot} @@ -170,7 +170,7 @@ in default = "mediawiki"; description = "Name of the database that holds the MediaWiki data."; }; - + dbServer = mkOption { default = ""; # use a Unix domain socket example = "10.0.2.2"; @@ -185,7 +185,7 @@ in default = "mediawiki"; description = "The user name for accessing the database."; }; - + dbPassword = mkOption { default = ""; example = "foobar"; @@ -194,7 +194,7 @@ in cleartext in the Nix store! ''; }; - + emergencyContact = mkOption { default = serverInfo.serverConfig.adminAddr; example = "admin@example.com"; @@ -203,7 +203,7 @@ in admin address. ''; }; - + passwordSender = mkOption { default = serverInfo.serverConfig.adminAddr; example = "password@example.com"; @@ -277,7 +277,7 @@ in extraPath = [ mediawikiScripts ]; # !!! Need to specify that Apache has a dependency on PostgreSQL! - + startupScript = pkgs.writeScript "mediawiki_startup.sh" # Initialise the database automagically if we're using a Postgres # server on localhost. diff --git a/modules/services/web-servers/apache-httpd/mercurial.nix b/modules/services/web-servers/apache-httpd/mercurial.nix index 45cb8197917..ad1c332a657 100644 --- a/modules/services/web-servers/apache-httpd/mercurial.nix +++ b/modules/services/web-servers/apache-httpd/mercurial.nix @@ -5,9 +5,9 @@ let inherit (pkgs.lib) mkOption; urlPrefix = config.urlPrefix; - + cgi = pkgs.stdenv.mkDerivation { - name = "mercurial-cgi"; + name = "mercurial-cgi"; buildCommand = '' ensureDir $out cp -v ${mercurial}/share/cgi-bin/hgweb.cgi $out @@ -21,7 +21,7 @@ let " > $out/hgweb.config ''; }; - + in { extraConfig = '' @@ -45,18 +45,18 @@ in { PassEnv PYTHONPATH ''; - + robotsEntries = '' User-agent: * Disallow: ${urlPrefix} ''; - + extraServerPath = [ - (pkgs.python+"/bin") + (pkgs.python+"/bin") ]; - + globalEnvVars = [ { name = "PYTHONPATH"; value = "${mercurial}/lib/${pkgs.python.libPrefix}/site-packages"; } ]; - + options = { urlPrefix = mkOption { default = "/hg"; @@ -65,7 +65,7 @@ in { Use the empty string to have it appear in the server root. "; }; - + dataDir = mkOption { example = "/data/mercurial"; description = " @@ -73,5 +73,5 @@ in { "; }; }; - + } diff --git a/modules/services/web-servers/apache-httpd/per-server-options.nix b/modules/services/web-servers/apache-httpd/per-server-options.nix index 8a2ee0e849a..00b82550bbe 100644 --- a/modules/services/web-servers/apache-httpd/per-server-options.nix +++ b/modules/services/web-servers/apache-httpd/per-server-options.nix @@ -40,9 +40,9 @@ # Note: sslServerCert and sslServerKey can be left empty, but this # only makes sense for virtual hosts (they will inherit from the # main server). - + sslServerCert = mkOption { - default = ""; + default = ""; example = "/var/host.cert"; description = " Path to server SSL certificate. diff --git a/modules/services/web-servers/apache-httpd/tomcat-connector.nix b/modules/services/web-servers/apache-httpd/tomcat-connector.nix index 00cca42c6e0..f815eeb290c 100644 --- a/modules/services/web-servers/apache-httpd/tomcat-connector.nix +++ b/modules/services/web-servers/apache-httpd/tomcat-connector.nix @@ -43,8 +43,8 @@ JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE -# Note: Changed from +ForwardURICompat. -# See http://tomcat.apache.org/security-jk.html +# Note: Changed from +ForwardURICompat. +# See http://tomcat.apache.org/security-jk.html JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories # JkRequestLogFormat @@ -63,13 +63,13 @@ JkMount /__application__/* loadbalancer # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly -# Note: Replaced JkShmFile logs/jk.shm due to SELinux issues. Refer to +# Note: Replaced JkShmFile logs/jk.shm due to SELinux issues. Refer to # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225452 JkShmFile ${config.stateDir}/jk.shm # Static files in all Tomcat webapp context directories are served by apache JkAutoAlias /var/tomcat/webapps - + # All requests go to worker by default JkMount /* loadbalancer # Serve some static files using httpd diff --git a/modules/services/web-servers/apache-httpd/trac.nix b/modules/services/web-servers/apache-httpd/trac.nix index 676aaa83178..5e31c1f2643 100644 --- a/modules/services/web-servers/apache-httpd/trac.nix +++ b/modules/services/web-servers/apache-httpd/trac.nix @@ -3,7 +3,7 @@ with pkgs.lib; let - + # Build a Subversion instance with Apache modules and Swig/Python bindings. subversion = pkgs.subversion.override (origArgs: { bdbSupport = true; @@ -14,18 +14,18 @@ let }); pythonLib = p: "${p}/"; - + in { options = { - + projectsLocation = mkOption { description = "URL path in which Trac projects can be accessed"; default = "/projects"; }; - + projects = mkOption { description = "List of projects that should be provided by Trac. If they are not defined yet empty projects are created."; default = []; @@ -37,7 +37,7 @@ in } ]; }; - + user = mkOption { default = "wwwrun"; description = "User account under which Trac runs."; @@ -64,12 +64,12 @@ in description = "AuthName"; }; }; - + }; extraModules = singleton { name = "python"; path = "${pkgs.mod_python}/modules/mod_python.so"; }; - + extraConfig = '' SetHandler mod_python @@ -89,7 +89,7 @@ in '' else ""} ''; - + globalEnvVars = singleton { name = "PYTHONPATH"; value = @@ -103,11 +103,11 @@ in subversion ]; }; - + startupScript = pkgs.writeScript "activateTrac" '' mkdir -p /var/trac chown ${config.user}:${config.group} /var/trac - + ${concatMapStrings (project: '' if [ ! -d /var/trac/${project.identifier} ] @@ -117,5 +117,5 @@ in fi '' ) (config.projects)} ''; - + } diff --git a/modules/services/web-servers/apache-httpd/zabbix.nix b/modules/services/web-servers/apache-httpd/zabbix.nix index 3c2a30322f4..66b6c0ea9b0 100644 --- a/modules/services/web-servers/apache-httpd/zabbix.nix +++ b/modules/services/web-servers/apache-httpd/zabbix.nix @@ -29,10 +29,10 @@ in max_execution_time = 300 mbstring.func_overload = 2 ''; - + extraConfig = '' Alias ${config.urlPrefix}/ ${zabbixPHP}/ - + DirectoryIndex index.php Order deny,allow diff --git a/modules/services/web-servers/jboss/default.nix b/modules/services/web-servers/jboss/default.nix index a1bdce50eee..e1bcede6563 100644 --- a/modules/services/web-servers/jboss/default.nix +++ b/modules/services/web-servers/jboss/default.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.services.jboss; - + jbossService = pkgs.stdenv.mkDerivation { name = "jboss-server"; builder = ./builder.sh; @@ -20,9 +20,9 @@ in ###### interface options = { - + services.jboss = { - + enable = mkOption { default = false; description = "Whether to enable jboss"; @@ -62,7 +62,7 @@ in default = false; description = "Whether to use to connector to the Apache HTTP server"; }; - + }; }; @@ -79,5 +79,5 @@ in }; }; - + } diff --git a/modules/services/web-servers/tomcat.nix b/modules/services/web-servers/tomcat.nix index 83b95655011..078877b15bc 100644 --- a/modules/services/web-servers/tomcat.nix +++ b/modules/services/web-servers/tomcat.nix @@ -5,7 +5,7 @@ with pkgs.lib; let cfg = config.services.tomcat; - + in { @@ -13,9 +13,9 @@ in ###### interface options = { - + services.tomcat = { - + enable = mkOption { default = false; description = "Whether to enable Apache Tomcat"; @@ -31,16 +31,16 @@ in example = [ "users" ]; description = "Defines extra groups to which the tomcat user belongs."; }; - + user = mkOption { default = "tomcat"; description = "User account under which Apache Tomcat runs."; - }; + }; group = mkOption { default = "tomcat"; description = "Group account under which Apache Tomcat runs."; - }; + }; javaOpts = mkOption { default = ""; @@ -73,12 +73,12 @@ in }; logPerVirtualHost = mkOption { - default = false; + default = false; description = "Whether to enable logging per virtual host."; - }; + }; axis2 = { - + enable = mkOption { default = false; description = "Whether to enable an Apache Axis2 container"; @@ -88,9 +88,9 @@ in default = []; description = "List containing AAR files or directories with AAR files which are web services to be deployed on Axis2"; }; - + }; - + }; }; @@ -104,7 +104,7 @@ in { name = "tomcat"; gid = config.ids.gids.tomcat; }; - + users.extraUsers = singleton { name = "tomcat"; uid = config.ids.uids.tomcat; @@ -112,7 +112,7 @@ in home = "/homeless-shelter"; extraGroups = cfg.extraGroups; }; - + jobs.tomcat = { description = "Apache Tomcat server"; @@ -122,62 +122,62 @@ in environment = { TZ = config.time.timeZone; }; preStart = - '' + '' # Create the base directory mkdir -p ${cfg.baseDir} - + # Create a symlink to the bin directory of the tomcat component ln -sfn ${pkgs.tomcat6}/bin ${cfg.baseDir}/bin - + # Create a conf/ directory mkdir -p ${cfg.baseDir}/conf chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/conf - + # Symlink the config files in the conf/ directory (except for catalina.properties and server.xml) for i in $(ls ${pkgs.tomcat6}/conf | grep -v catalina.properties | grep -v server.xml) do ln -sfn ${pkgs.tomcat6}/conf/$i ${cfg.baseDir}/conf/`basename $i` done - + # Create subdirectory for virtual hosts mkdir -p ${cfg.baseDir}/virtualhosts - - # Create a modified catalina.properties file + + # Create a modified catalina.properties file # Change all references from CATALINA_HOME to CATALINA_BASE and add support for shared libraries sed -e 's|''${catalina.home}|''${catalina.base}|g' \ -e 's|shared.loader=|shared.loader=''${catalina.base}/shared/lib/*.jar|' \ ${pkgs.tomcat6}/conf/catalina.properties > ${cfg.baseDir}/conf/catalina.properties - + # Create a modified server.xml which also includes all virtual hosts sed -e "//a\ ${ toString (map (virtualHost: ''${if cfg.logPerVirtualHost then '''' else ""}'') cfg.virtualHosts)}" \ ${pkgs.tomcat6}/conf/server.xml > ${cfg.baseDir}/conf/server.xml - + # Create a logs/ directory mkdir -p ${cfg.baseDir}/logs chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs - ${if cfg.logPerVirtualHost then + ${if cfg.logPerVirtualHost then toString (map (h: '' mkdir -p ${cfg.baseDir}/logs/${h.name} chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/logs/${h.name} '') cfg.virtualHosts) else ''''} - + # Create a temp/ directory mkdir -p ${cfg.baseDir}/temp chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/temp - # Create a lib/ directory + # Create a lib/ directory mkdir -p ${cfg.baseDir}/lib chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/lib - + # Create a shared/lib directory mkdir -p ${cfg.baseDir}/shared/lib chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/shared/lib - + # Create a webapps/ directory mkdir -p ${cfg.baseDir}/webapps chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps - + # Symlink all the given common libs files or paths into the lib/ directory for i in ${pkgs.tomcat6} ${toString cfg.commonLibs} do @@ -189,13 +189,13 @@ in then # If the given web application is a directory, then iterate over the files # in the special purpose directories and symlink them into the tomcat tree - + for j in $i/lib/* do ln -sfn $j ${cfg.baseDir}/lib/`basename $j` done fi - done + done # Symlink all the given shared libs files or paths into the shared/lib/ directory for i in ${toString cfg.sharedLibs} @@ -208,14 +208,14 @@ in then # If the given web application is a directory, then iterate over the files # in the special purpose directories and symlink them into the tomcat tree - + for j in $i/shared/lib/* do ln -sfn $j ${cfg.baseDir}/shared/lib/`basename $j` done fi - done - + done + # Symlink all the given web applications files or paths into the webapps/ directory for i in ${toString cfg.webapps} do @@ -227,12 +227,12 @@ in then # If the given web application is a directory, then iterate over the files # in the special purpose directories and symlink them into the tomcat tree - + for j in $i/webapps/* do ln -sfn $j ${cfg.baseDir}/webapps/`basename $j` done - + # Also symlink the configuration files if they are included if [ -d $i/conf/Catalina ] then @@ -243,15 +243,15 @@ in done fi fi - done - + done + ${toString (map (virtualHost: '' # Create webapps directory for the virtual host mkdir -p ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps - + # Modify ownership chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps - + # Symlink all the given web applications files or paths into the webapps/ directory # of this virtual host for i in "${if virtualHost ? webapps then toString virtualHost.webapps else ""}" @@ -264,12 +264,12 @@ in then # If the given web application is a directory, then iterate over the files # in the special purpose directories and symlink them into the tomcat tree - + for j in $i/webapps/* do ln -sfn $j ${cfg.baseDir}/virtualhosts/${virtualHost.name}/webapps/`basename $j` done - + # Also symlink the configuration files if they are included if [ -d $i/conf/Catalina ] then @@ -279,27 +279,27 @@ in ln -sfn $j ${cfg.baseDir}/conf/Catalina/${virtualHost.name}/`basename $j` done fi - fi + fi done - + '' ) cfg.virtualHosts) } - + # Create a work/ directory mkdir -p ${cfg.baseDir}/work chown ${cfg.user}:${cfg.group} ${cfg.baseDir}/work - + ${if cfg.axis2.enable then '' # Copy the Axis2 web application cp -av ${pkgs.axis2}/webapps/axis2 ${cfg.baseDir}/webapps - + # Turn off addressing, which causes many errors sed -i -e 's%%%' ${cfg.baseDir}/webapps/axis2/WEB-INF/conf/axis2.xml - + # Modify permissions on the Axis2 application chown -R ${cfg.user}:${cfg.group} ${cfg.baseDir}/webapps/axis2 - + # Symlink all the given web service files or paths into the webapps/axis2/WEB-INF/services directory for i in ${toString cfg.axis2.services} do @@ -311,12 +311,12 @@ in then # If the given web application is a directory, then iterate over the files # in the special purpose directories and symlink them into the tomcat tree - + for j in $i/webapps/axis2/WEB-INF/services/* do ln -sfn $j ${cfg.baseDir}/webapps/axis2/WEB-INF/services/`basename $j` done - + # Also symlink the configuration files if they are included if [ -d $i/conf/Catalina ] then @@ -326,13 +326,13 @@ in done fi fi - done + done '' else ""} ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh ${cfg.user} -c 'CATALINA_BASE=${cfg.baseDir} JAVA_HOME=${pkgs.jdk} JAVA_OPTS="${cfg.javaOpts}" CATALINA_OPTS="${cfg.catalinaOpts}" ${pkgs.tomcat6}/bin/startup.sh' ''; - + postStop = '' echo "Stopping tomcat..." diff --git a/modules/services/x11/desktop-managers/default.nix b/modules/services/x11/desktop-managers/default.nix index d1343c1c0ec..79d65b19699 100644 --- a/modules/services/x11/desktop-managers/default.nix +++ b/modules/services/x11/desktop-managers/default.nix @@ -10,7 +10,7 @@ let # Whether desktop manager `d' is capable of setting a background. # If it isn't, the `feh' program is used as a fallback. needBGCond = d: ! (d ? bgSupport && d.bgSupport); - + in { @@ -20,7 +20,7 @@ in imports = [ ./none.nix ./xterm.nix ./xfce.nix ./gnome.nix ./kde4.nix ]; options = { - + services.xserver.desktopManager = { session = mkOption { @@ -64,7 +64,7 @@ in }; }; - + }; config = { diff --git a/modules/services/x11/desktop-managers/kde4.nix b/modules/services/x11/desktop-managers/kde4.nix index 3be115094d5..cce5ef54df1 100644 --- a/modules/services/x11/desktop-managers/kde4.nix +++ b/modules/services/x11/desktop-managers/kde4.nix @@ -30,7 +30,7 @@ in }; - + config = mkIf (xcfg.enable && cfg.enable) { # If KDE 4 is enabled, make it the default desktop manager (unless @@ -86,7 +86,7 @@ in (if !isKDE47 then # KDE <= 4.6 [ # temporary workarounds - pkgs.shared_desktop_ontologies + pkgs.shared_desktop_ontologies pkgs.strigi pkgs.kde4.kdelibs diff --git a/modules/services/x11/desktop-managers/xfce.nix b/modules/services/x11/desktop-managers/xfce.nix index eccba4ec480..25d3f4d11e1 100644 --- a/modules/services/x11/desktop-managers/xfce.nix +++ b/modules/services/x11/desktop-managers/xfce.nix @@ -22,7 +22,7 @@ in }; - + config = mkIf (xcfg.enable && cfg.enable) { services.xserver.desktopManager.session = singleton @@ -32,7 +32,7 @@ in '' # Set GTK_PATH so that GTK+ can find the Xfce theme engine. export GTK_PATH=${pkgs.xfce.gtk_xfce_engine}/lib/gtk-2.0 - + # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes. export GTK_DATA_PREFIX=${config.system.path} @@ -86,12 +86,12 @@ in '' export GIO_EXTRA_MODULES=${pkgs.xfce.gvfs}/lib/gio/modules ''; - + # Enable helpful DBus services. services.hal = mkIf (!isXfce48) { enable = true; }; services.udisks = mkIf isXfce48 { enable = true; }; services.upower = mkIf (isXfce48 && config.powerManagement.enable) { enable = true; }; - + }; } diff --git a/modules/services/x11/desktop-managers/xterm.nix b/modules/services/x11/desktop-managers/xterm.nix index 8524c0c6544..7aa70269dc4 100644 --- a/modules/services/x11/desktop-managers/xterm.nix +++ b/modules/services/x11/desktop-managers/xterm.nix @@ -14,7 +14,7 @@ let }; }; - + in mkIf cfg.enable { diff --git a/modules/services/x11/display-managers/auto.nix b/modules/services/x11/display-managers/auto.nix index e2b1ee42e83..cccc6e62a15 100644 --- a/modules/services/x11/display-managers/auto.nix +++ b/modules/services/x11/display-managers/auto.nix @@ -14,9 +14,9 @@ in ###### interface options = { - + services.xserver.displayManager.auto = { - + enable = mkOption { default = false; description = '' @@ -42,7 +42,7 @@ in config = mkIf cfg.enable { services.xserver.displayManager.slim.enable = false; - + services.xserver.displayManager.job = { execCmd = '' diff --git a/modules/services/x11/display-managers/default.nix b/modules/services/x11/display-managers/default.nix index 7e21f27ff69..2261d417d04 100644 --- a/modules/services/x11/display-managers/default.nix +++ b/modules/services/x11/display-managers/default.nix @@ -207,24 +207,24 @@ in description = "This option defines how to start the display manager."; options = { - + preStart = mkOption { default = ""; example = "rm -f /var/log/my-display-manager.log"; description = "Script executed before the display manager is started."; }; - + execCmd = mkOption { example = "${pkgs.slim}/bin/slim"; description = "Command to start the display manager."; }; - + environment = mkOption { default = {}; example = { SLIM_CFGFILE = /etc/slim.conf; }; description = "Additional environment variables needed by the display manager."; }; - + logsXsession = mkOption { default = false; description = '' @@ -233,13 +233,13 @@ in ~/.xsession-errors. ''; }; - + }; - + }; }; - + }; } diff --git a/modules/services/x11/display-managers/kdm.nix b/modules/services/x11/display-managers/kdm.nix index f82e83d7e49..cfcf62e487e 100644 --- a/modules/services/x11/display-managers/kdm.nix +++ b/modules/services/x11/display-managers/kdm.nix @@ -36,11 +36,11 @@ let [X-*-Greeter] HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10 PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so - + ${optionalString (cfg.enableXDMCP) '' [Xdmcp] - Enable=true + Enable=true ''} ''; @@ -59,11 +59,11 @@ in { ###### interface - + options = { services.xserver.displayManager.kdm = { - + enable = mkOption { default = false; description = '' @@ -85,18 +85,18 @@ in configuration file of KDM. ''; }; - + }; }; - - + + ###### implementation - + config = mkIf cfg.enable { services.xserver.displayManager.slim.enable = false; - + services.xserver.displayManager.job = { execCmd = '' @@ -109,7 +109,7 @@ in }; security.pam.services = [ { name = "kde"; } ]; - + users.extraUsers = singleton { name = "kdm"; uid = config.ids.uids.kdm; @@ -117,5 +117,5 @@ in }; }; - + } diff --git a/modules/services/x11/display-managers/slim.nix b/modules/services/x11/display-managers/slim.nix index 0e48cae7423..6e34bc2eb51 100644 --- a/modules/services/x11/display-managers/slim.nix +++ b/modules/services/x11/display-managers/slim.nix @@ -41,9 +41,9 @@ in ###### interface options = { - + services.xserver.displayManager.slim = { - + enable = mkOption { default = true; description = '' diff --git a/modules/services/x11/hardware/multitouch.nix b/modules/services/x11/hardware/multitouch.nix index d360902f2ab..ae0ae2e5a3a 100644 --- a/modules/services/x11/hardware/multitouch.nix +++ b/modules/services/x11/hardware/multitouch.nix @@ -28,7 +28,7 @@ with pkgs.lib; Section "InputClass" MatchIsTouchpad "true" Identifier "Multitouch Touchpad" - Driver "multitouch" + Driver "multitouch" EndSection ''; diff --git a/modules/services/x11/hardware/synaptics.nix b/modules/services/x11/hardware/synaptics.nix index 2cb85aaeb52..554180049be 100644 --- a/modules/services/x11/hardware/synaptics.nix +++ b/modules/services/x11/hardware/synaptics.nix @@ -9,7 +9,7 @@ let cfg = config.services.xserver.synaptics; in options = { services.xserver.synaptics = { - + enable = mkOption { default = false; example = true; @@ -19,7 +19,7 @@ let cfg = config.services.xserver.synaptics; in dev = mkOption { default = null; example = "/dev/input/event0"; - description = + description = '' Path for touchpad device. Set to null to apply to any auto-detected touchpad. diff --git a/modules/services/x11/window-managers/awesome.nix b/modules/services/x11/window-managers/awesome.nix index 0746bd34b9d..880ebf1eca6 100644 --- a/modules/services/x11/window-managers/awesome.nix +++ b/modules/services/x11/window-managers/awesome.nix @@ -13,7 +13,7 @@ in ###### interface options = { - + services.xserver.windowManager.awesome.enable = mkOption { default = false; description = "Enable the Awesome window manager."; @@ -36,7 +36,7 @@ in }; environment.x11Packages = [ pkgs.awesome ]; - + }; } diff --git a/modules/services/x11/window-managers/compiz.nix b/modules/services/x11/window-managers/compiz.nix index fd439a3cddc..209401f2646 100644 --- a/modules/services/x11/window-managers/compiz.nix +++ b/modules/services/x11/window-managers/compiz.nix @@ -8,13 +8,13 @@ let xorg = config.services.xserver.package; in - + { options = { services.xserver.windowManager.compiz = { - + enable = mkOption { default = false; description = "Enable the Compiz window manager."; @@ -25,14 +25,14 @@ in example = "--indirect-rendering"; description = "Pass the flag to Compiz."; }; - + }; }; - + config = mkIf cfg.enable { - + services.xserver.windowManager.session = singleton { name = "compiz"; start = diff --git a/modules/services/x11/window-managers/icewm.nix b/modules/services/x11/window-managers/icewm.nix index 1aec252dea5..9da4a415fad 100644 --- a/modules/services/x11/window-managers/icewm.nix +++ b/modules/services/x11/window-managers/icewm.nix @@ -13,7 +13,7 @@ in ###### interface options = { - + services.xserver.windowManager.icewm.enable = mkOption { default = false; description = "Enable the IceWM window manager."; @@ -36,7 +36,7 @@ in }; environment.x11Packages = [ pkgs.icewm ]; - + }; } diff --git a/modules/services/x11/window-managers/twm.nix b/modules/services/x11/window-managers/twm.nix index 3c4780386ce..c1a99b97566 100644 --- a/modules/services/x11/window-managers/twm.nix +++ b/modules/services/x11/window-managers/twm.nix @@ -13,7 +13,7 @@ in ###### interface options = { - + services.xserver.windowManager.twm.enable = mkOption { default = false; description = "Enable the twm window manager."; @@ -36,7 +36,7 @@ in }; environment.x11Packages = [ pkgs.xorg.twm ]; - + }; } diff --git a/modules/services/x11/xfs.nix b/modules/services/x11/xfs.nix index 424e386b78b..edaafacc27e 100644 --- a/modules/services/x11/xfs.nix +++ b/modules/services/x11/xfs.nix @@ -5,12 +5,12 @@ with pkgs.lib; let configFile = ./xfs.conf; - + startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces"; - + in { @@ -18,7 +18,7 @@ in ###### interface options = { - + services.xfs = { enable = mkOption { @@ -40,12 +40,12 @@ in jobs.xfs = { description = "X Font Server"; - + startOn = "started ${startingDependency}"; exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}"; }; }); - + } diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix index 15240d65cee..f1e8044fc6b 100644 --- a/modules/services/x11/xserver.nix +++ b/modules/services/x11/xserver.nix @@ -71,7 +71,7 @@ let done fi done - + for i in $(find ${toString cfg.modules} -type d); do if test $(echo $i/*.so* | wc -w) -ne 0; then echo " ModulePath \"$i\"" >> $out @@ -79,7 +79,7 @@ let done echo 'EndSection' >> $out - + echo "$config" >> $out ''; # */ }; @@ -96,9 +96,9 @@ in ###### interface - + options = { - + services.xserver = { enable = mkOption { @@ -311,7 +311,7 @@ in Virtual screen size for Xrandr. ''; }; - + }; environment.x11Packages = mkOption { @@ -322,7 +322,7 @@ in activated (). ''; }; - + }; @@ -337,7 +337,7 @@ in { boot.extraModulePackages = - optional (elem "nvidia" driverNames) kernelPackages.nvidia_x11 ++ + optional (elem "nvidia" driverNames) kernelPackages.nvidia_x11 ++ optional (elem "nvidiaLegacy96" driverNames) kernelPackages.nvidia_x11_legacy96 ++ optional (elem "nvidiaLegacy173" driverNames) kernelPackages.nvidia_x11_legacy173 ++ optional (elem "virtualbox" driverNames) kernelPackages.virtualboxGuestAdditions ++ @@ -352,7 +352,7 @@ in target = "X11/xkb"; } ]; - + environment.x11Packages = [ xorg.xorgserver xorg.xrandr @@ -370,7 +370,7 @@ in ++ optional (elem "nvidiaLegacy173" driverNames) kernelPackages.nvidia_x11_legacy173 ++ optional (elem "virtualbox" driverNames) xorg.xrefresh ++ optional (elem "ati_unfree" driverNames) kernelPackages.ati_drivers_x11; - + environment.systemPackages = config.environment.x11Packages; environment.pathsToLink = @@ -378,7 +378,7 @@ in jobs.xserver = { startOn = if cfg.autorun then "filesystem and stopped udevtrigger" else ""; - + environment = { FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup XKB_BINDIR = "${xorg.xkbcomp}/bin"; # Needed for the Xkb extension. @@ -440,7 +440,7 @@ in [ xorg.xorgserver xorg.xf86inputevdev ]; - + services.xserver.config = '' Section "ServerFlags" @@ -478,7 +478,7 @@ in # For each supported driver, add a "Device" and "Screen" # section. ${flip concatMapStrings drivers (driver: '' - + Section "Device" Identifier "Device-${driver.name}[0]" Driver "${driver.driverName}" @@ -521,7 +521,7 @@ in ''; in concatMapStrings f [8 16 24] )} - + EndSection '')} ''; diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index b2246a1447d..72566507ecc 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -18,18 +18,18 @@ let pkgs.shadow pkgs.nettools # needed for hostname ]; - + in { ###### interface - + options = { - + system.activationScripts = mkOption { default = {}; - + example = { stdio = { text = '' @@ -42,21 +42,21 @@ in deps = []; }; }; - + description = '' Activate the new configuration (i.e., update /etc, make accounts, and so on). ''; - + merge = mergeTypedOption "script" builtins.isAttrs (fold mergeAttrs {}); - + apply = set: { script = '' #! ${pkgs.stdenv.shell} systemConfig=@out@ - + export PATH=/empty for i in ${toString path}; do PATH=$PATH:$i/bin:$i/sbin; @@ -79,12 +79,12 @@ in ln -sfn /var/run/current-system /nix/var/nix/gcroots/current-system ''; }; - + }; - + }; - + ###### implementation config = { @@ -128,7 +128,7 @@ in '' mkdir -p /media ''; - + system.activationScripts.cgroups = '' if ! ${pkgs.sysvtools}/bin/mountpoint -q /dev/cgroup; then @@ -136,7 +136,7 @@ in ${pkgs.utillinux}/bin/mount -t cgroup -o freezer,cpuacct,cpu,cpuset none /dev/cgroup fi ''; - + }; - + } diff --git a/modules/system/activation/top-level.nix b/modules/system/activation/top-level.nix index 92615c78f32..b98242c3f33 100644 --- a/modules/system/activation/top-level.nix +++ b/modules/system/activation/top-level.nix @@ -3,7 +3,7 @@ let options = { - + system.build = pkgs.lib.mkOption { default = {}; description = '' @@ -58,14 +58,14 @@ let This code will be added to the builder creating the system store path. ''; }; - + }; - - # This attribute is responsible for creating boot entries for + + # 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 + # you can provide an easy way to boot the same configuration # as you use, but with another kernel # !!! fix this cloner = inheritParent: list: with pkgs.lib; @@ -99,12 +99,12 @@ let ln -s ${kernelPath} $out/kernel ln -s ${config.system.modulesTree} $out/kernel-modules - if [ -n "$grub" ]; then + if [ -n "$grub" ]; then ln -s $grub $out/grub fi - + ln -s ${config.system.build.initialRamdisk}/initrd $out/initrd - + echo "$activationScript" > $out/activate substituteInPlace $out/activate --subst-var out chmod u+x $out/activate @@ -112,7 +112,7 @@ let cp ${config.system.build.bootStage2} $out/init substituteInPlace $out/init --subst-var-by systemConfig $out - + ln -s ${config.system.build.etc}/etc $out/etc ln -s ${config.system.path} $out/sw ln -s ${config.system.build.upstart} $out/upstart @@ -136,7 +136,7 @@ let ${config.system.extraSystemBuilderCmds} ''; - + # Putting it all together. This builds a store path containing # symlinks to the various parts of the built configuration (the # kernel, the Upstart services, the init scripts, etc.) as well as a @@ -167,7 +167,7 @@ let if config.boot.loader.grub.enable then config.system.build.grub else null; - grubVersion = + grubVersion = if config.boot.loader.grub.enable then (builtins.parseDrvName config.system.build.grub.name).version else ""; diff --git a/modules/system/boot/luksroot.nix b/modules/system/boot/luksroot.nix index a01395647a3..c28f46ef75b 100644 --- a/modules/system/boot/luksroot.nix +++ b/modules/system/boot/luksroot.nix @@ -15,7 +15,7 @@ in description = ''; The device that should be decrypted using LUKS before trying to mount the root partition. This works for both LVM-over-LUKS and LUKS-over-LVM setups. - + Make sure that initrd has the crypto modules needed for decryption. The decrypted device name is /dev/mapper/luksroot. @@ -42,4 +42,4 @@ in }; -} \ No newline at end of file +} diff --git a/modules/system/boot/modprobe.nix b/modules/system/boot/modprobe.nix index fe667ce59c5..5be5546163a 100644 --- a/modules/system/boot/modprobe.nix +++ b/modules/system/boot/modprobe.nix @@ -19,14 +19,14 @@ with pkgs.lib; '' #! ${pkgs.stdenv.shell} export MODULE_DIR=${config.system.modulesTree}/lib/modules - + # Fall back to the kernel modules used at boot time if the # modules in the current configuration don't match the # running kernel. if [ ! -d "$MODULE_DIR/$(${pkgs.coreutils}/bin/uname -r)" ]; then MODULE_DIR=/var/run/booted-system/kernel-modules/lib/modules fi - + exec ${pkgs.module_init_tools}/sbin/modprobe "$@" ''; }; @@ -44,7 +44,7 @@ with pkgs.lib; automatically by the hardware probing code. ''; }; - + boot.extraModprobeConfig = mkOption { default = ""; example = @@ -59,7 +59,7 @@ with pkgs.lib; 5 for details. ''; }; - + }; @@ -101,7 +101,7 @@ with pkgs.lib; # module. echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe ''; - + }; } diff --git a/modules/system/upstart-events/shutdown.nix b/modules/system/upstart-events/shutdown.nix index cc89a97e88d..cf06ba10d08 100644 --- a/modules/system/upstart-events/shutdown.nix +++ b/modules/system/upstart-events/shutdown.nix @@ -20,7 +20,7 @@ with pkgs.lib; set +e # continue in case of errors ${pkgs.kbd}/bin/chvt 1 - + exec < /dev/console > /dev/console 2>&1 echo "" if test "$MODE" = maintenance; then @@ -31,7 +31,7 @@ with pkgs.lib; echo "" ${config.powerManagement.powerDownCommands} - + export PATH=${pkgs.utillinux}/bin:${pkgs.utillinux}/sbin:$PATH @@ -44,10 +44,10 @@ with pkgs.lib; # event, as these are necessary to complete the shutdown. omittedPids=$(initctl list | sed -e 's/.*process \([0-9]\+\)/-o \1/;t;d') #echo "saved PIDs: $omittedPids" - + echo "sending the TERM signal to all processes..." ${pkgs.sysvtools}/bin/killall5 -15 $job $omittedPids - + sleep 1 # wait briefly echo "sending the KILL signal to all processes..." @@ -95,7 +95,7 @@ with pkgs.lib; # mount points are typically tmpfs/aufs mounts from # the initrd. if [ "$mp" = /proc -o "$mp" = /sys -o "$mp" = /dev -o "$device" = "rootfs" -o "$mp" = /run -o "$mp" = /var/run -o "$mp" = /var/lock -o ! -e "$mp" ]; then continue; fi - + echo "unmounting $mp..." # We need to remount,ro before attempting any @@ -132,8 +132,8 @@ with pkgs.lib; # Final sync. sync - - + + # Either reboot or power-off the system. if test "$MODE" = reboot; then echo "rebooting..." diff --git a/modules/system/upstart/upstart.nix b/modules/system/upstart/upstart.nix index 368405badc7..09e81983e81 100644 --- a/modules/system/upstart/upstart.nix +++ b/modules/system/upstart/upstart.nix @@ -16,7 +16,7 @@ let upstart ]; - + # From a job description, generate an Upstart job file. makeJob = job: @@ -29,7 +29,7 @@ let let log = "/var/log/upstart/${job.name}"; in '' # Upstart job `${job.name}'. This is a generated file. Do not edit. - + description "${job.description}" ${if isList job.startOn then @@ -38,20 +38,20 @@ let "start on ${job.startOn}" else "" } - + ${optionalString (job.stopOn != "") "stop on ${job.stopOn}"} env PATH=${makeSearchPath "bin" (job.path ++ upstartPath)}:${makeSearchPath "sbin" (job.path ++ upstartPath)} ${concatMapStrings (n: "env ${n}=\"${getAttr n env}\"\n") (attrNames env)} - + ${optionalString (job.preStart != "") '' pre-start script exec >> ${log} 2>&1 ${job.preStart} end script ''} - + ${if job.script != "" && job.exec != "" then abort "Job ${job.name} has both a `script' and `exec' attribute." else if job.script != "" then @@ -77,7 +77,7 @@ let ${job.postStart} end script ''} - + ${optionalString job.task "task"} ${optionalString (!job.task && job.respawn) "respawn"} @@ -116,7 +116,7 @@ let echo "$jobText" > $out ''; - + jobOptions = { name = mkOption { @@ -149,7 +149,7 @@ let startOn = mkOption { # !!! Re-enable this once we're on Upstart >= 0.6. - #type = types.string; + #type = types.string; default = ""; description = '' The Upstart event that triggers this job to be started. @@ -278,16 +278,16 @@ let default = [ ]; description = '' Packages added to the job's PATH environment variable. - Both the bin and sbin + Both the bin and sbin subdirectories of each package are added. ''; }; }; - + upstartJob = {name, config, ...}: { - + options = { jobDrv = mkOption { default = makeJob config; @@ -305,15 +305,15 @@ let replaceChars ["<" ">" "*"] ["_" "_" "_name_"] name ); }; - + }; in - + { ###### interface - + options = { jobs = mkOption { @@ -325,7 +325,7 @@ in type = types.loaOf types.optionSet; options = [ jobOptions upstartJob ]; }; - + tests.upstartJobs = mkOption { internal = true; default = {}; @@ -335,7 +335,7 @@ in tests.upstartJobs.xserver). ''; }; - + system.upstartEnvironment = mkOption { type = types.attrs; default = {}; @@ -349,7 +349,7 @@ in ###### implementation - + config = { system.build.upstart = upstart; diff --git a/modules/tasks/filesystems.nix b/modules/tasks/filesystems.nix index 271c0ba0c4e..3ee26bbfc77 100644 --- a/modules/tasks/filesystems.nix +++ b/modules/tasks/filesystems.nix @@ -29,7 +29,7 @@ in label = "bigdisk"; } ]; - + description = " The file systems to be mounted. It must include an entry for the root directory (mountPoint = \"/\"). Each @@ -46,10 +46,10 @@ in systems that support it, such as ext2/ext3 (see mke2fs -L). - autocreate forces mountPoint to be created with + autocreate forces mountPoint to be created with mkdir -p . "; - + type = types.nullOr (types.loaOf types.optionSet); apply = x: attrValues x; @@ -114,7 +114,7 @@ in }; }; }; - + system.sbin.mount = mkOption { internal = true; default = pkgs.utillinuxng; @@ -122,7 +122,7 @@ in Package containing mount and umount. "; }; - + }; @@ -134,7 +134,7 @@ in environment.systemPackages = [ pkgs.ntfs3g pkgs.cifs_utils pkgs.nfsUtils pkgs.mountall ] ++ fsPackages; - + environment.etc = singleton { source = pkgs.writeText "fstab" '' @@ -170,7 +170,7 @@ in + optionalString config.services.nfsKernel.client.enable " and started nfs-kernel-statd"; task = true; - + script = '' exec > /dev/console 2>&1 @@ -218,7 +218,7 @@ in script = '' [ -n "$MOUNTPOINT" ] || exit 0 - + exec < /dev/console > /dev/console 2>&1 cat <boot.extraTTYs to ["tty7"]. ''; }; - + # dummy option so that requiredTTYs can be passed requiredTTYs = mkOption { default = []; @@ -44,18 +44,18 @@ in FIXME: find a good description. "; }; - + }; ###### implementation - config = { - + config = { + inherit requiredTTYs; # pass it to ./modules/tasks/tty-backgrounds.nix environment.systemPackages = [pkgs.kbd]; - + jobs.kbd = { description = "Keyboard / console initialisation"; @@ -82,7 +82,7 @@ in for tty in ${toString ttys}; do # Tell the console output driver that the bytes arriving are - # UTF-8 encoded multibyte sequences. + # UTF-8 encoded multibyte sequences. echo -n -e '\033%G' > $tty done @@ -98,7 +98,7 @@ in for tty in ${toString ttys}; do # Tell the console output driver that the bytes arriving are - # UTF-8 encoded multibyte sequences. + # UTF-8 encoded multibyte sequences. echo -n -e '\033%@' > $tty done diff --git a/modules/tasks/lvm.nix b/modules/tasks/lvm.nix index 875bf97ff25..f5a40c7f8ec 100644 --- a/modules/tasks/lvm.nix +++ b/modules/tasks/lvm.nix @@ -30,5 +30,5 @@ services.udev.packages = [ pkgs.lvm2 ]; }; - + } diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix index fab61b79c98..f3603127b26 100644 --- a/modules/tasks/network-interfaces.nix +++ b/modules/tasks/network-interfaces.nix @@ -6,7 +6,7 @@ let cfg = config.networking; -in +in { @@ -120,7 +120,7 @@ in }; }; - + }; networking.ifaces = mkOption { @@ -132,7 +132,7 @@ in as an attribute set keyed on the interface name. ''; }; - + networking.bridges = mkOption { default = { }; example = @@ -160,7 +160,7 @@ in }; }; - + }; }; @@ -179,13 +179,13 @@ in pkgs.nettools pkgs.wirelesstools pkgs.rfkill - ] + ] ++ optional (cfg.bridges != {}) pkgs.bridge_utils ++ optional cfg.enableIPv6 pkgs.ndisc6; security.setuidPrograms = [ "ping" "ping6" ]; - - jobs.networkInterfaces = + + jobs.networkInterfaces = { name = "network-interfaces"; startOn = "stopped udevtrigger"; @@ -195,7 +195,7 @@ in preStart = '' set +e # continue in case of errors - + ${flip concatMapStrings cfg.interfaces (i: optionalString (i.macAddress != "") '' @@ -213,7 +213,7 @@ in ${concatStrings (attrValues (flip mapAttrs cfg.bridges (n: v: '' echo "Creating bridge ${n}..." ${pkgs.bridge_utils}/sbin/brctl addbr "${n}" - + ${flip concatMapStrings v.interfaces (i: '' ${pkgs.bridge_utils}/sbin/brctl addif "${n}" "${i}" ip addr flush dev "${i}" @@ -226,11 +226,11 @@ in ${optionalString cfg.enableIPv6 '' echo 5 > /proc/sys/net/ipv6/conf/${n}/router_solicitations ''} - + # !!! Should delete (brctl delif) any interfaces that # no longer belong to the bridge. '')))} - + # Configure the manually specified interfaces. ${flip concatMapStrings cfg.interfaces (i: optionalString (i.ipAddress != "") @@ -276,5 +276,5 @@ in ''; }; - + } diff --git a/modules/tasks/swraid.nix b/modules/tasks/swraid.nix index 21fe809f058..3b4aa9875f2 100644 --- a/modules/tasks/swraid.nix +++ b/modules/tasks/swraid.nix @@ -3,9 +3,9 @@ { environment.systemPackages = [ pkgs.mdadm ]; - + services.udev.packages = [ pkgs.mdadm ]; boot.initrd.availableKernelModules = [ "md_mod" "raid0" "raid1" "raid456" ]; - + } diff --git a/modules/tasks/tty-backgrounds.nix b/modules/tasks/tty-backgrounds.nix index 265c7a57bf2..aca01b428a5 100644 --- a/modules/tasks/tty-backgrounds.nix +++ b/modules/tasks/tty-backgrounds.nix @@ -5,16 +5,16 @@ with pkgs.lib; let inherit (pkgs) stdenv; - + kernelPackages = config.boot.kernelPackages; splashutils = kernelPackages.splashutils; requiredTTYs = config.requiredTTYs; - + backgrounds = let - + specificThemes = config.services.ttyBackgrounds.specificThemes; - + overridenTTYs = map (x: x.tty) specificThemes; # Use the default theme for all the mingetty ttys and for the @@ -23,7 +23,7 @@ let defaultTTYs = filter (x: !(elem x overridenTTYs)) requiredTTYs; - in + in (map (tty: { inherit tty; }) defaultTTYs) ++ specificThemes; themesUnpacked = stdenv.mkDerivation { @@ -44,9 +44,9 @@ in { ###### interface - + options = { - + services.ttyBackgrounds = { enable = mkOption { @@ -74,9 +74,9 @@ in This option overrides the theme for specific virtual consoles. ''; }; - + }; - + }; @@ -142,7 +142,7 @@ in done ''; }; - + }); - + } diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index 873c8a9d6d0..26ea31802fe 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -18,7 +18,7 @@ let ''; in - + { config = @@ -30,7 +30,7 @@ in jobs.backdoor = { startOn = "startup"; stopOn = "never"; - + script = '' export USER=root @@ -56,7 +56,7 @@ in # timeouts in the VM should also be delayed). echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource ''; - + boot.postBootCommands = '' # Panic on out-of-memory conditions rather than letting the @@ -77,7 +77,7 @@ in boot.kernelModules = [ "gcov-proc" ]; # Panic if an error occurs in stage 1 (rather than waiting for - # user intervention). + # user intervention). boot.kernelParams = [ "console=tty1" "console=ttyS0" "panic=1" "stage1panic=1" ]; @@ -90,7 +90,7 @@ in # Disable "-- MARK --" messages. These prevent hanging tests from # being killed after 1 hour of silence. services.syslogd.extraParams = [ "-m 0" ]; - + # Don't run klogd. Kernel messages appear on the serial console anyway. jobs.klogd.startOn = mkOverride 50 ""; @@ -99,7 +99,7 @@ in networking.nameservers = mkOverride 150 [ ]; system.upstartEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data"; - + }; } diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index 109746b0f94..c7b3184b17e 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -15,7 +15,7 @@ with pkgs.lib; ${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G" ''; buildInputs = [ pkgs.utillinux pkgs.perl ]; - exportReferencesGraph = + exportReferencesGraph = [ "closure" config.system.build.toplevel ]; } '' @@ -27,7 +27,7 @@ with pkgs.lib; # The initrd expects these directories to exist. mkdir /mnt/dev /mnt/proc /mnt/sys - + mount -o bind /proc /mnt/proc # Copy all paths in the closure to the filesystem. @@ -83,9 +83,9 @@ with pkgs.lib; boot.loader.grub.timeout = 0; boot.loader.grub.extraPerEntryConfig = "root (hd0)"; - # Put /tmp and /var on /ephemeral0, which has a lot more space. - # Unfortunately we can't do this with the `fileSystems' option - # because it has no support for creating the source of a bind + # Put /tmp and /var on /ephemeral0, which has a lot more space. + # Unfortunately we can't do this with the `fileSystems' option + # because it has no support for creating the source of a bind # mount. Also, "move" /nix to /ephemeral0 by layering an AUFS # on top of it so we have a lot more space for Nix operations. boot.initrd.postMountCommands = diff --git a/modules/virtualisation/libvirtd.nix b/modules/virtualisation/libvirtd.nix index b8cc0cddd6d..91168aa7df5 100644 --- a/modules/virtualisation/libvirtd.nix +++ b/modules/virtualisation/libvirtd.nix @@ -4,9 +4,9 @@ with pkgs.lib; -let +let - cfg = config.virtualisation.libvirtd; + cfg = config.virtualisation.libvirtd; in @@ -15,7 +15,7 @@ in options = { - virtualisation.libvirtd.enable = + virtualisation.libvirtd.enable = mkOption { default = false; description = @@ -27,7 +27,7 @@ in ''; }; - virtualisation.libvirtd.enableKVM = + virtualisation.libvirtd.enableKVM = mkOption { default = true; description = @@ -43,7 +43,7 @@ in config = mkIf cfg.enable { - environment.systemPackages = + environment.systemPackages = [ pkgs.libvirt ] ++ optional cfg.enableKVM pkgs.qemu_kvm; @@ -59,7 +59,7 @@ in pkgs.ebtables ] ++ optional cfg.enableKVM pkgs.qemu_kvm; - preStart = + preStart = '' mkdir -p /var/log/libvirt/qemu -m 755 rm -f /var/run/libvirtd.pid @@ -100,7 +100,7 @@ in # !!! Split this into save and restore tasks. jobs.libvirt_guests = { name = "libvirt-guests"; - + description = "Job to save/restore libvirtd VMs"; startOn = "started libvirtd"; @@ -111,7 +111,7 @@ in path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ]; - preStart = + preStart = '' mkdir -p /var/lock/subsys -m 755 ${pkgs.libvirt}/etc/rc.d/init.d/libvirt-guests start || true diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix index 2a904cdd88c..96b637b3019 100644 --- a/modules/virtualisation/nova-image.nix +++ b/modules/virtualisation/nova-image.nix @@ -15,7 +15,7 @@ with pkgs.lib; ${pkgs.vmTools.kvm}/bin/qemu-img create -f raw $diskImage "4G" ''; buildInputs = [ pkgs.utillinux pkgs.perl ]; - exportReferencesGraph = + exportReferencesGraph = [ "closure" config.system.build.toplevel ]; } '' @@ -24,7 +24,7 @@ with pkgs.lib; ${pkgs.parted}/sbin/parted /dev/vda -- mkpart primary ext2 1M -1s . /sys/class/block/vda1/uevent mknod /dev/vda1 b $MAJOR $MINOR - + # Create an empty filesystem and mount it. ${pkgs.e2fsprogs}/sbin/mkfs.ext3 -L nixos /dev/vda1 ${pkgs.e2fsprogs}/sbin/tune2fs -c 0 -i 0 /dev/vda1 @@ -83,9 +83,9 @@ with pkgs.lib; boot.loader.grub.device = "/dev/vda"; boot.loader.grub.timeout = 0; - # Put /tmp and /var on /ephemeral0, which has a lot more space. - # Unfortunately we can't do this with the `fileSystems' option - # because it has no support for creating the source of a bind + # Put /tmp and /var on /ephemeral0, which has a lot more space. + # Unfortunately we can't do this with the `fileSystems' option + # because it has no support for creating the source of a bind # mount. Also, "move" /nix to /ephemeral0 by layering an AUFS # on top of it so we have a lot more space for Nix operations. /* diff --git a/modules/virtualisation/nova.nix b/modules/virtualisation/nova.nix index fa26b7d54ea..fcaf1c0073b 100644 --- a/modules/virtualisation/nova.nix +++ b/modules/virtualisation/nova.nix @@ -25,7 +25,7 @@ in options = { - virtualisation.nova.enableSingleNode = + virtualisation.nova.enableSingleNode = mkOption { default = false; description = @@ -41,7 +41,7 @@ in ''; }; - virtualisation.nova.extraConfig = + virtualisation.nova.extraConfig = mkOption { default = false; description = @@ -84,10 +84,10 @@ in # nova-api) to work. mkdir -m 700 -p /var/lib/nova/CA /var/lib/nova/CA/private - # Initialise the SQLite database. + # Initialise the SQLite database. ${nova}/bin/nova-manage db sync ''; - + # `nova-api' receives and executes external client requests from # tools such as euca2ools. It listens on port 8773 (XML) and 8774 # (JSON). @@ -103,7 +103,7 @@ in path = [ pkgs.openssl pkgs.openssh pkgs.bash ]; respawn = false; - + exec = "${nova}/bin/nova-api --flagfile=${novaConf} --api_paste_config=${nova}/etc/nova/api-paste.ini"; }; diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 93212af2dfc..95502821e35 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -13,14 +13,14 @@ with pkgs.lib; let - vmName = - if config.networking.hostName == "" - then "noname" + vmName = + if config.networking.hostName == "" + then "noname" else config.networking.hostName; options = { - - virtualisation.memorySize = + + virtualisation.memorySize = mkOption { default = 384; description = @@ -28,8 +28,8 @@ let Memory size (M) of virtual machine. ''; }; - - virtualisation.diskSize = + + virtualisation.diskSize = mkOption { default = 512; description = @@ -37,7 +37,7 @@ let Disk size (M) of virtual machine. ''; }; - + virtualisation.diskImage = mkOption { default = "./${vmName}.qcow2"; @@ -48,7 +48,7 @@ let exist. ''; }; - + virtualisation.graphics = mkOption { default = true; @@ -72,7 +72,7 @@ let ''; }; - virtualisation.vlans = + virtualisation.vlans = mkOption { default = [ 1 ]; example = [ 1 2 ]; @@ -89,7 +89,7 @@ let ''; }; - virtualisation.writableStore = + virtualisation.writableStore = mkOption { default = false; description = @@ -127,7 +127,7 @@ let altogether. ''; }; - + }; cfg = config.virtualisation; @@ -140,7 +140,7 @@ let startVM = '' #! ${pkgs.stdenv.shell} - + NIX_DISK_IMAGE=$(readlink -f ''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}}) if ! test -e "$NIX_DISK_IMAGE"; then @@ -178,7 +178,7 @@ let $QEMU_OPTS ''; - + regInfo = pkgs.runCommand "reginfo" { exportReferencesGraph = map (x: [("closure-" + baseNameOf x) x]) config.virtualisation.pathsInNixDB; @@ -221,21 +221,21 @@ let echo '(hd0) /dev/vda' > /boot/grub/device.map # Install GRUB and generate the GRUB boot menu. - touch /etc/NIXOS + touch /etc/NIXOS mkdir -p /nix/var/nix/profiles ${config.system.build.toplevel}/bin/switch-to-configuration boot umount /boot '' ); - + in { require = [ options ../profiles/qemu-guest.nix ]; boot.loader.grub.device = mkOverride 50 "/dev/vda"; - + # All the modules the initrd needs to mount the host filesystem via # CIFS. Also use paravirtualised network and block devices for # performance. @@ -255,7 +255,7 @@ in cp ${pkgs.iproute}/sbin/ip $out/bin cp ${pkgs.glibc}/lib/libresolv.so.* $out/lib ''; - + boot.initrd.postDeviceCommands = '' # Set up networking. Needed for CIFS mounting. @@ -274,7 +274,7 @@ in '' # Fix the permissions on /tmp. chmod 1777 $targetRoot/tmp - + mkdir -p $targetRoot/boot mount -o remount,ro $targetRoot/nix/store ${optionalString cfg.writableStore '' @@ -283,7 +283,7 @@ in mount -t aufs -o dirs=/mnt-store-tmpfs=rw:$targetRoot/nix/store=rr none $targetRoot/nix/store ''} ''; - + # After booting, register the closure of the paths in # `virtualisation.pathsInNixDB' in the Nix database in the VM. This # allows Nix operations to work in the VM. The path to the @@ -299,11 +299,11 @@ in fi ) ''; - + virtualisation.pathsInNixDB = [ config.system.build.toplevel ]; virtualisation.qemu.options = [ "-vga std" "-usbdevice tablet" ]; - + # Mount the host filesystem via CIFS, and bind-mount the Nix store # of the host into our own filesystem. We use mkOverride to allow # this module to be applied to "normal" NixOS system configuration, @@ -351,7 +351,7 @@ in # Don't run ntpd in the guest. It should get the correct time from KVM. services.ntp.enable = false; - + system.build.vm = pkgs.runCommand "nixos-vm" {} '' ensureDir $out/bin diff --git a/modules/virtualisation/xen-dom0.nix b/modules/virtualisation/xen-dom0.nix index cb71f4137ab..8c2f6c738c1 100644 --- a/modules/virtualisation/xen-dom0.nix +++ b/modules/virtualisation/xen-dom0.nix @@ -4,9 +4,9 @@ with pkgs.lib; -let +let - cfg = config.virtualisation.xen; + cfg = config.virtualisation.xen; xen = pkgs.xen; @@ -24,7 +24,7 @@ in options = { - virtualisation.xen.enable = + virtualisation.xen.enable = mkOption { default = false; description = @@ -38,7 +38,7 @@ in ''; }; - virtualisation.xen.bootParams = + virtualisation.xen.bootParams = mkOption { default = ""; description = @@ -47,7 +47,7 @@ in ''; }; - virtualisation.xen.domain0MemorySize = + virtualisation.xen.domain0MemorySize = mkOption { default = 0; example = 512; @@ -70,8 +70,8 @@ in # Domain 0 requires a pvops-enabled kernel. boot.kernelPackages = pkgs.linuxPackages_2_6_32_xen; - boot.kernelModules = - [ "xen_evtchn" "xen_gntdev" "xen_blkback" "xen_netback" "xen_pciback" + boot.kernelModules = + [ "xen_evtchn" "xen_gntdev" "xen_blkback" "xen_netback" "xen_pciback" "blktap" "tun" ]; @@ -87,7 +87,7 @@ in options loop max_loop=64 ''; - virtualisation.xen.bootParams = + virtualisation.xen.bootParams = [ "loglvl=all" "guest_loglvl=all" ] ++ optional (cfg.domain0MemorySize != 0) "dom0_mem=${toString cfg.domain0MemorySize}M"; @@ -111,19 +111,19 @@ in startOn = "stopped udevtrigger"; - path = - [ pkgs.bridge_utils pkgs.gawk pkgs.iproute pkgs.nettools + path = + [ pkgs.bridge_utils pkgs.gawk pkgs.iproute pkgs.nettools pkgs.utillinux pkgs.bash xen pkgs.pciutils pkgs.procps ]; environment.XENCONSOLED_TRACE = "hv"; - preStart = + preStart = '' mkdir -p /var/log/xen/console -m 0700 ${xen}/sbin/xend start - + # Wait until Xend is running. for ((i = 0; i < 60; i++)); do echo "waiting for xend..."; ${xen}/sbin/xend status && break; done @@ -144,7 +144,7 @@ in environment.XENDOM_CONFIG = "${xen}/etc/sysconfig/xendomains"; - preStart = + preStart = '' mkdir -p /var/lock/subsys -m 755 ${xen}/etc/init.d/xendomains start diff --git a/modules/virtualisation/xen-domU.nix b/modules/virtualisation/xen-domU.nix index a83e5dc612e..29ab8f8b3af 100644 --- a/modules/virtualisation/xen-domU.nix +++ b/modules/virtualisation/xen-domU.nix @@ -18,7 +18,7 @@ services.syslogd.tty = "hvc0"; # Start a mingetty on the Xen console (so that you can login using - # "xm console" in Dom0). + # "xm console" in Dom0). services.mingetty.ttys = [ "hvc0" "tty1" "tty2" ]; # Don't run ntpd, since we should get the correct time from Dom0. diff --git a/release.nix b/release.nix index d3c6308197f..1ba256e5d3b 100644 --- a/release.nix +++ b/release.nix @@ -25,7 +25,7 @@ let inherit system nixpkgs; modules = [ module versionModule ]; }).config; - + iso = config.system.build.isoImage; in @@ -85,11 +85,11 @@ let releaseTools.makeSourceTarball { name = "nixos-tarball"; - + version = builtins.readFile ./VERSION; - + src = nixosSrc; - + inherit officialRelease; distPhase = '' @@ -115,7 +115,7 @@ let inherit nixpkgs; modules = [ { fileSystems = []; } ]; }).options; - revision = + revision = if nixosSrc.rev == 1234 then "HEAD" else toString nixosSrc.rev; }).manual; @@ -130,7 +130,7 @@ let type = "graphical"; }; - + # Provide a tarball that can be unpacked into an SD card, and easily # boot that system from uboot (like for the sheevaplug). # The pc variant helps preparing the expression for the system tarball @@ -152,9 +152,9 @@ let } { system = "armv5tel-linux"; }; - tests = + tests = let - t = import ./tests { + t = import ./tests { inherit nixpkgs; system = "i686-linux"; }; @@ -187,6 +187,6 @@ let }; }; - + in jobs diff --git a/tests/bittorrent.nix b/tests/bittorrent.nix index dce8e3b3725..8951e5bad1b 100644 --- a/tests/bittorrent.nix +++ b/tests/bittorrent.nix @@ -19,13 +19,13 @@ let listening_ip=${nodes.router.config.networking.ifaces.eth2.ipAddress}/24 allow 1024-65535 192.168.2.0/24 1024-65535 ''; - + in { nodes = - { tracker = + { tracker = { config, pkgs, ... }: { environment.systemPackages = [ pkgs.transmission pkgs.bittorrent ]; @@ -35,7 +35,7 @@ in services.httpd.documentRoot = "/tmp"; }; - router = + router = { config, pkgs, ... }: { environment.systemPackages = [ pkgs.miniupnpd ]; virtualisation.vlans = [ 1 2 ]; @@ -44,7 +44,7 @@ in networking.nat.externalInterface = "eth1"; }; - client1 = + client1 = { config, pkgs, nodes, ... }: { environment.systemPackages = [ pkgs.transmission ]; virtualisation.vlans = [ 2 ]; @@ -52,7 +52,7 @@ in nodes.router.config.networking.ifaces.eth2.ipAddress; }; - client2 = + client2 = { config, pkgs, ... }: { environment.systemPackages = [ pkgs.transmission ]; }; @@ -103,5 +103,5 @@ in $client2->waitForFile("/tmp/test.tar.bz2"); $client2->succeed("cmp /tmp/test.tar.bz2 ${file}"); ''; - + } diff --git a/tests/check-filesystems.nix b/tests/check-filesystems.nix index 882f5cd3153..ba2bf352ec8 100644 --- a/tests/check-filesystems.nix +++ b/tests/check-filesystems.nix @@ -44,9 +44,9 @@ rec { autocreate = true; device = "share:/repos2"; }; - in pkgs.lib.mkOverrideTemplate 50 {} [ + in pkgs.lib.mkOverrideTemplate 50 {} [ repos1 - repos1 # check remount + repos1 # check remount repos2 # check after remount ]; @@ -56,7 +56,7 @@ rec { }; }; }; - + vms = buildVirtualNetwork { inherit nodes; }; test = runTests vms diff --git a/tests/firefox.nix b/tests/firefox.nix index 7e1e192c808..adb936dc1ae 100644 --- a/tests/firefox.nix +++ b/tests/firefox.nix @@ -2,7 +2,7 @@ { - machine = + machine = { config, pkgs, ... }: { require = [ ./common/x11.nix ]; @@ -17,5 +17,5 @@ $machine->sleep(40); # wait until Firefox has finished loading the page $machine->screenshot("screen"); ''; - + } diff --git a/tests/firewall.nix b/tests/firewall.nix index d2d2568f1cd..b38cd988b76 100644 --- a/tests/firewall.nix +++ b/tests/firewall.nix @@ -5,7 +5,7 @@ { nodes = - { walled = + { walled = { config, pkgs, nodes, ... }: { networking.firewall.enable = true; networking.firewall.logRefusedPackets = true; @@ -13,7 +13,7 @@ services.httpd.adminAddr = "foo@example.org"; }; - attacker = + attacker = { config, pkgs, ... }: { services.httpd.enable = true; services.httpd.adminAddr = "foo@example.org"; diff --git a/tests/installer.nix b/tests/installer.nix index bc88c7c68a4..900457dfabd 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -13,9 +13,9 @@ let modules = [ ../modules/installer/cd-dvd/installation-cd-graphical.nix ../modules/testing/test-instrumentation.nix - { key = "serial"; + { key = "serial"; boot.loader.grub.timeout = mkOverrideTemplate 0 {} 0; - + # The test cannot access the network, so any sources we # need must be included in the ISO. isoImage.storeContents = @@ -27,7 +27,7 @@ let ]; }).config.system.build.isoImage; - + # The configuration to install. config = { fileSystems, testChannel }: pkgs.writeText "configuration.nix" '' @@ -42,7 +42,7 @@ let boot.loader.grub.device = "/dev/vda"; boot.loader.grub.extraConfig = "serial; terminal_output.serial"; boot.initrd.kernelModules = [ "ext3" "virtio_console" ]; - + fileSystems = [ ${fileSystems} ]; swapDevices = [ { label = "swap"; } ]; @@ -56,7 +56,7 @@ let device = "/dev/disk/by-label/nixos"; } ''; - + bootFS = '' { mountPoint = "/boot"; @@ -64,10 +64,10 @@ let } ''; - + # Configuration of a web server that simulates the Nixpkgs channel # distribution server. - webserver = + webserver = { config, pkgs, ... }: { services.httpd.enable = true; @@ -82,7 +82,7 @@ let }; channelContents = [ pkgs.hello.src pkgs.rlwrap ]; - + # The test script boots the CD, installs NixOS on an empty hard # disk, and then reboot from the hard disk. It's parameterized with @@ -93,7 +93,7 @@ let '' createDisk("harddisk", 4 * 1024); - my $machine = createMachine({ hda => "harddisk", cdrom => glob("${iso}/iso/*.iso"), + my $machine = createMachine({ hda => "harddisk", cdrom => glob("${iso}/iso/*.iso"), qemuFlags => '${if testChannel then qemuNICFlags 1 1 2 else ""}'}); $machine->start; @@ -108,7 +108,7 @@ let "http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable " . "file:///tmp/channel/MANIFEST ${toString channelContents} >&2"); ''} - + # Make sure that we get a login prompt etc. $machine->mustSucceed("echo hello"); $machine->waitForJob("tty1"); @@ -150,14 +150,14 @@ let # Perform the installation. $machine->mustSucceed("nixos-install >&2"); - + $machine->mustSucceed("cat /mnt/boot/grub/grub.cfg >&2"); - + $machine->shutdown; # Now see if we can boot the installation. my $machine = createMachine({ hda => "harddisk" }); - + # Did /boot get mounted, if appropriate? # !!! There is currently no good way to wait for the # `filesystems' task to finish. @@ -166,7 +166,7 @@ let # Did the swap device get activated? # !!! Idem. $machine->waitUntilSucceeds("cat /proc/swaps | grep -q /dev"); - + $machine->mustSucceed("nix-env -i coreutils >&2"); $machine->mustSucceed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/ or die "nix-env failed"; @@ -174,7 +174,7 @@ let $machine->mustSucceed("nixos-rebuild switch >&2"); $machine->mustSucceed("cat /boot/grub/grub.cfg >&2"); - + $machine->shutdown; # And just to be sure, check that the machine still boots after @@ -184,7 +184,7 @@ let $machine->shutdown; ''; - + makeTest = { createPartitions, fileSystems, testChannel ? false }: { inherit iso; nodes = if testChannel then { inherit webserver; } else { }; @@ -192,7 +192,7 @@ let inherit createPartitions fileSystems testChannel; }; }; - + in { @@ -202,7 +202,7 @@ in { # The (almost) simplest partitioning scheme: a swap partition and # one big filesystem partition. simple = makeTest - { createPartitions = + { createPartitions = '' $machine->mustSucceed( "parted /dev/vda mklabel msdos", @@ -218,7 +218,7 @@ in { fileSystems = rootFS; testChannel = true; }; - + # Same as the previous, but now with a separate /boot partition. separateBoot = makeTest { createPartitions = @@ -240,7 +240,7 @@ in { ''; fileSystems = rootFS + bootFS; }; - + # Create two physical LVM partitions combined into one volume group # that contains the logical swap and root partitions. lvm = makeTest @@ -296,7 +296,7 @@ in { }; # Rebuild the CD configuration with a little modification. - rebuildCD = + rebuildCD = { inherit iso; nodes = { }; testScript = diff --git a/tests/ipv6.nix b/tests/ipv6.nix index 76958ab445d..4a308416aef 100644 --- a/tests/ipv6.nix +++ b/tests/ipv6.nix @@ -7,14 +7,14 @@ nodes = { client = { config, pkgs, ... }: { }; - + server = { config, pkgs, ... }: { services.httpd.enable = true; services.httpd.adminAddr = "foo@example.org"; }; - router = + router = { config, pkgs, ... }: { services.radvd.enable = true; services.radvd.config = @@ -32,9 +32,9 @@ '' # Start the router first so that it respond to router solicitations. $router->waitForJob("radvd"); - + startAll; - + $client->waitForJob("network-interfaces"); $server->waitForJob("network-interfaces"); @@ -48,12 +48,12 @@ $machine->log("$scope address on $iface is $ip"); return $ip; } - + subtest "loopback address", sub { - $client->succeed("ping6 -c 1 ::1 >&2"); - $client->fail("ping6 -c 1 ::2 >&2"); + $client->succeed("ping6 -c 1 ::1 >&2"); + $client->fail("ping6 -c 1 ::2 >&2"); }; - + subtest "local link addressing", sub { my $clientIp = waitForAddress $client, "eth1", "link"; my $serverIp = waitForAddress $server, "eth1", "link"; diff --git a/tests/kde4.nix b/tests/kde4.nix index ff75758429d..afdf1754942 100644 --- a/tests/kde4.nix +++ b/tests/kde4.nix @@ -2,7 +2,7 @@ { - machine = + machine = { config, pkgs, ... }: { require = [ ./common/user-account.nix ]; @@ -40,8 +40,8 @@ $machine->waitForWindow(qr/Valgrind.*Konqueror/); $machine->sleep(5); - + $machine->screenshot("screen"); ''; - + } diff --git a/tests/login.nix b/tests/login.nix index 3567b6bc246..90987782f8c 100644 --- a/tests/login.nix +++ b/tests/login.nix @@ -23,7 +23,7 @@ $machine->sendChars("touch done\n"); $machine->waitForFile("/home/alice/done"); }; - + # Check whether switching VTs works. subtest "virtual console switching", sub { $machine->sendKeys("alt-f10"); @@ -50,12 +50,12 @@ $machine->waitUntilFails("pgrep -u alice bash"); $machine->screenshot("mingetty"); }; - + # Check whether ctrl-alt-delete works. subtest "ctrl-alt-delete", sub { $machine->sendKeys("ctrl-alt-delete"); $machine->waitForShutdown; }; ''; - + } diff --git a/tests/mysql-replication.nix b/tests/mysql-replication.nix index db72e45f685..5ac7f0a5097 100644 --- a/tests/mysql-replication.nix +++ b/tests/mysql-replication.nix @@ -6,9 +6,9 @@ let in { nodes = { - master = + master = { pkgs, config, ... }: - + { services.mysql.enable = true; services.mysql.replication.role = "master"; @@ -19,22 +19,22 @@ in grant replication slave on *.* to '${replicateUser}'@'%'; ''; }; - + slave1 = { pkgs, config, nodes, ... }: - + { services.mysql.enable = true; services.mysql.replication.role = "slave"; services.mysql.replication.serverId = 2; services.mysql.replication.masterHost = nodes.master.config.networking.hostName; services.mysql.replication.masterUser = replicateUser; - services.mysql.replication.masterPassword = replicatePassword; + services.mysql.replication.masterPassword = replicatePassword; }; - + slave2 = { pkgs, config, nodes, ... }: - + { services.mysql.enable = true; services.mysql.replication.role = "slave"; @@ -44,10 +44,10 @@ in services.mysql.replication.masterPassword = replicatePassword; }; }; - + testScript = '' startAll; - + $master->waitForJob("mysql"); $master->waitForJob("mysql"); $slave2->waitForJob("mysql"); diff --git a/tests/mysql.nix b/tests/mysql.nix index cb8f1247909..65785c8fdb5 100644 --- a/tests/mysql.nix +++ b/tests/mysql.nix @@ -2,19 +2,19 @@ { nodes = { - master = + master = { pkgs, config, ... }: - + { services.mysql.enable = true; services.mysql.replication.role = "master"; services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ]; - }; + }; }; - + testScript = '' startAll; - + $master->waitForJob("mysql"); $master->sleep(10); # Hopefully this is long enough!! $master->mustSucceed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4"); diff --git a/tests/nat.nix b/tests/nat.nix index 5466106a43d..5adbf3ce57d 100644 --- a/tests/nat.nix +++ b/tests/nat.nix @@ -9,14 +9,14 @@ { nodes = - { client = + { client = { config, pkgs, nodes, ... }: { virtualisation.vlans = [ 1 ]; networking.defaultGateway = nodes.router.config.networking.ifaces.eth2.ipAddress; }; - router = + router = { config, pkgs, ... }: { virtualisation.vlans = [ 2 1 ]; networking.nat.enable = true; @@ -24,7 +24,7 @@ networking.nat.externalInterface = "eth1"; }; - server = + server = { config, pkgs, ... }: { virtualisation.vlans = [ 2 ]; services.httpd.enable = true; @@ -49,19 +49,19 @@ $client->waitForJob("network-interfaces"); $client->succeed("curl --fail http://server/ >&2"); $client->succeed("ping -c 1 server >&2"); - + # Test whether passive FTP works. $server->waitForJob("vsftpd"); $server->succeed("echo Hello World > /home/ftp/foo.txt"); $client->succeed("curl -v ftp://server/foo.txt >&2"); - + # Test whether active FTP works. $client->succeed("curl -v -P - ftp://server/foo.txt >&2"); # Test ICMP. $client->succeed("ping -c 1 router >&2"); $router->succeed("ping -c 1 client >&2"); - + # If we turn off NAT, the client shouldn't be able to reach the server. $router->succeed("stop nat"); $client->fail("curl --fail --connect-timeout 5 http://server/ >&2"); diff --git a/tests/nfs.nix b/tests/nfs.nix index c8ead3d8930..e4576e451b8 100644 --- a/tests/nfs.nix +++ b/tests/nfs.nix @@ -2,14 +2,14 @@ let - client = + client = { config, pkgs, ... }: - { fileSystems = pkgs.lib.mkOverride 50 + { fileSystems = pkgs.lib.mkOverride 50 [ { mountPoint = "/data"; device = "server:/data"; fsType = "nfs"; options = "bootwait"; - } + } ]; }; @@ -21,7 +21,7 @@ in { client1 = client; client2 = client; - server = + server = { config, pkgs, ... }: { services.nfsKernel.server.enable = true; services.nfsKernel.server.exports = @@ -52,7 +52,7 @@ in # seconds because the NFS server waits that long after booting # before accepting new locks. $client2->succeed("time flock -n -s /data/lock true"); - + # Test locking: client 1 acquires an exclusive lock, so client 2 # should then fail to acquire a shared lock. $client1->succeed("flock -x /data/lock -c 'touch locked; sleep 100000' &"); diff --git a/tests/openssh.nix b/tests/openssh.nix index 0e8bd3e2b9d..5818c9d6ceb 100644 --- a/tests/openssh.nix +++ b/tests/openssh.nix @@ -2,33 +2,33 @@ { nodes = { - - server = + + server = { config, pkgs, ... }: - + { services.openssh.enable = true; }; - - client = + + client = { config, pkgs, ... }: { }; - + }; - + testScript = '' startAll; - + my $key=`${pkgs.openssh}/bin/ssh-keygen -t dsa -f key -N ""`; $server->waitForJob("sshd"); - + $server->mustSucceed("mkdir -m 700 /root/.ssh"); $server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys"); - + $client->mustSucceed("mkdir -m 700 /root/.ssh"); $client->copyFileFromHost("key", "/root/.ssh/id_dsa"); $client->mustSucceed("chmod 600 /root/.ssh/id_dsa"); - + $client->waitForJob("network-interfaces"); $client->mustSucceed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world'"); ''; diff --git a/tests/proxy.nix b/tests/proxy.nix index 685d5a36f5d..323b548de74 100644 --- a/tests/proxy.nix +++ b/tests/proxy.nix @@ -2,7 +2,7 @@ let - backend = + backend = { config, pkgs, ... }: { diff --git a/tests/quake3.nix b/tests/quake3.nix index c21a1506b65..fbd0adab2fa 100644 --- a/tests/quake3.nix +++ b/tests/quake3.nix @@ -11,10 +11,10 @@ let }; in - + rec { - client = + client = { config, pkgs, ... }: { require = [ ./common/x11.nix ]; @@ -52,7 +52,7 @@ rec { $client1->execute("quake3 '+set r_fullscreen 0' '+set name Foo' '+connect server' &"); $client2->execute("quake3 '+set r_fullscreen 0' '+set name Bar' '+connect server' &"); - + $server->waitUntilSucceeds("grep -q 'Foo.*entered the game' /tmp/log"); $server->waitUntilSucceeds("grep -q 'Bar.*entered the game' /tmp/log"); @@ -76,5 +76,5 @@ rec { $client2->shutdown(); $server->succeed("stop quake3-server"); ''; - + } diff --git a/tests/remote-builds.nix b/tests/remote-builds.nix index f55520b3501..80ba9c71e73 100644 --- a/tests/remote-builds.nix +++ b/tests/remote-builds.nix @@ -5,7 +5,7 @@ let # The configuration of the build slaves. - slave = + slave = { config, pkgs, ... }: { services.openssh.enable = true; virtualisation.writableStore = true; diff --git a/tests/subversion.nix b/tests/subversion.nix index 4a1ed62978e..fb8bba93806 100644 --- a/tests/subversion.nix +++ b/tests/subversion.nix @@ -30,7 +30,7 @@ let }; in - + { nodes = @@ -73,11 +73,11 @@ in # Create a new user through the web interface. $client->mustSucceed("curl --fail -F username=alice -F fullname='Alice Lastname' -F address=alice\@example.org -F password=foobar -F password_again=foobar http://webserver/repoman/adduser"); - # Let Alice create a new repository. + # Let Alice create a new repository. $client->mustSucceed("curl --fail -u alice:foobar --form repo=xyzzy --form description=Xyzzy http://webserver/repoman/create"); $client->mustSucceed("curl --fail http://webserver/") =~ /alice/ or die; - + # Let Alice do a checkout. my $svnFlags = "--non-interactive --username alice --password foobar"; $client->mustSucceed("svn co $svnFlags http://webserver/repos/xyzzy wc"); @@ -98,10 +98,10 @@ in # !!! Repoman should really return a 403 here. $client->succeed("curl --fail -u bob:fnord -F description=Xyzzy -F readers=alice,bob -F writers=alice -F watchers= -F tardirs= http://webserver/repoman/update/xyzzy") =~ /not authorised/ or die; - + # Give Bob access. $client->mustSucceed("curl --fail -u alice:foobar -F description=Xyzzy -F readers=alice,bob -F writers=alice -F watchers= -F tardirs= http://webserver/repoman/update/xyzzy"); - + # So now his checkout should succeed. $client->mustSucceed("svn co $svnFlagsBob http://webserver/repos/xyzzy wc2"); diff --git a/tests/tomcat.nix b/tests/tomcat.nix index bf601e834e1..0726a782250 100644 --- a/tests/tomcat.nix +++ b/tests/tomcat.nix @@ -2,9 +2,9 @@ { nodes = { - server = + server = { pkgs, config, ... }: - + { services.tomcat.enable = true; services.httpd.enable = true; @@ -16,10 +16,10 @@ } ]; }; - + client = { }; }; - + testScript = '' startAll; diff --git a/tests/trac.nix b/tests/trac.nix index 9f3ea90261f..e13c0f15752 100644 --- a/tests/trac.nix +++ b/tests/trac.nix @@ -2,7 +2,7 @@ { nodes = { - storage = + storage = {pkgs, config, ...}: { services.portmap.enable = true; @@ -28,16 +28,16 @@ ''; }; - webserver = + webserver = {config, pkgs, ...}: { - fileSystems = pkgs.lib.mkOverride 50 + fileSystems = pkgs.lib.mkOverride 50 [ { mountPoint = "/repos"; device = "storage:/repos"; fsType = "nfs"; - options = "bootwait"; } + options = "bootwait"; } ]; - + services.portmap.enable = true; services.nfsKernel.client.enable = true; services.httpd.enable = true; @@ -45,34 +45,34 @@ services.httpd.extraSubservices = [ { serviceType = "trac"; } ]; environment.systemPackages = [ pkgs.pythonPackages.trac pkgs.subversion ]; }; - - client = + + client = {config, pkgs, ...}: { require = [ ./common/x11.nix ]; services.xserver.desktopManager.kde4.enable = true; }; }; - + testScript = '' startAll; - + $postgresql->waitForJob("postgresql"); $postgresql->mustSucceed("createdb trac"); - + $webserver->mustSucceed("mkdir -p /repos/trac"); $webserver->mustSucceed("svnadmin create /repos/trac"); - - $webserver->waitForFile("/var/trac"); + + $webserver->waitForFile("/var/trac"); $webserver->mustSucceed("mkdir -p /var/trac/projects/test"); $webserver->mustSucceed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac"); - + $client->waitForX; $client->execute("konqueror http://webserver/projects/test &"); $client->waitForWindow(qr/Test.*Konqueror/); $client->sleep(30); # loading takes a long time - + $client->screenshot("screen"); ''; } diff --git a/tests/xfce.nix b/tests/xfce.nix index b9114baf370..0975cd88883 100644 --- a/tests/xfce.nix +++ b/tests/xfce.nix @@ -2,7 +2,7 @@ { - machine = + machine = { config, pkgs, ... }: { require = [ ./common/user-account.nix ]; @@ -11,22 +11,22 @@ services.xserver.displayManager.auto.enable = true; services.xserver.displayManager.auto.user = "alice"; - + services.xserver.desktopManager.xfce.enable = true; }; testScript = '' - $machine->waitForWindow(qr/Tips/); + $machine->waitForWindow(qr/Tips/); $machine->sleep(10); # Check that logging in has given the user ownership of devices. $machine->succeed("getfacl /dev/snd/timer | grep -q alice"); - + $machine->succeed("su - alice -c 'DISPLAY=:0.0 Terminal &'"); $machine->waitForWindow(qr/Terminal/); $machine->sleep(10); $machine->screenshot("screen"); ''; - + }