From 65700b435c8a495e5ff7071e41db34bf49b9ef89 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 May 2015 15:48:45 +0200 Subject: Use ConditionVirtualization to disable some services in containers (cherry picked from commit c52a98380673093037a3116025d0aa92cd46a214) --- nixos/modules/system/boot/systemd.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 2ad12c51b218..d001feb063b4 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -749,6 +749,10 @@ in systemd.targets.local-fs.unitConfig.X-StopOnReconfiguration = true; systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true; + # Don't bother with certain units in containers. + systemd.services.systemd-remount-fs.unitConfig.ConditionVirtualization = "!container"; + systemd.services.systemd-random-seed.unitConfig.ConditionVirtualization = "!container"; + }; } -- cgit 1.4.1 From 6bd4e0b8cd8a5f043492846d7ee4531349962102 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 May 2015 15:54:16 +0200 Subject: Create systemd-{network,resolve} user/group unconditionally This shuts up this error from dbus: May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file which happens because the D-Bus config for networkd/resolved is enabled unconditionally, and we don't have an easy way to turn it off. (cherry picked from commit f19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0) --- nixos/modules/system/boot/networkd.nix | 3 --- nixos/modules/system/boot/resolved.nix | 3 --- nixos/modules/system/boot/systemd.nix | 5 +++++ 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index b183c0f32366..34eea9af83b1 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -641,9 +641,6 @@ in environment.etc."systemd/network".source = generateUnits "network" cfg.units [] []; - users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network; - users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network; - systemd.services.systemd-networkd = { wantedBy = [ "multi-user.target" ]; before = [ "network-interfaces.target" ]; diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix index ecd547322d3c..5a98b9b6d480 100644 --- a/nixos/modules/system/boot/resolved.nix +++ b/nixos/modules/system/boot/resolved.nix @@ -30,9 +30,6 @@ with lib; DNS=${concatStringsSep " " config.networking.nameservers} ''; - users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve; - users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve; - }; } diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index d001feb063b4..557dc204fca3 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -648,6 +648,11 @@ in ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true ''; + users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network; + users.extraGroups.systemd-network.gid = config.ids.gids.systemd-network; + users.extraUsers.systemd-resolve.uid = config.ids.uids.systemd-resolve; + users.extraGroups.systemd-resolve.gid = config.ids.gids.systemd-resolve; + # Target for ‘charon send-keys’ to hook into. users.extraGroups.keys.gid = config.ids.gids.keys; -- cgit 1.4.1 From 9647609e3eb687079d2120b57bdf095d8643671f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 May 2015 15:59:11 +0200 Subject: stage-1: Don't mount /dev/shm if it's already mounted (cherry picked from commit c8ef5989452e191a1d345cd006f54305cb989af6) --- nixos/modules/system/boot/stage-2-init.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh index 173453a17f71..330e2f97c5bf 100644 --- a/nixos/modules/system/boot/stage-2-init.sh +++ b/nixos/modules/system/boot/stage-2-init.sh @@ -85,8 +85,10 @@ done # More special file systems, initialise required directories. -mkdir -m 0755 /dev/shm -mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm +if ! mountpoint -q /dev/shm; then + mkdir -m 0755 /dev/shm + mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm +fi mkdir -m 0755 -p /dev/pts [ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default mkdir -m 01777 -p /tmp -- cgit 1.4.1 From ec82157ac5b36560c7edae4acfe47edb57133991 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 May 2015 16:22:49 +0200 Subject: stage-2: Don't run hwclock in containers (cherry picked from commit b978df019a2b1281f7a70445eaa71b45049f4cfd) --- nixos/modules/system/boot/stage-2-init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh index 330e2f97c5bf..a73070ab332f 100644 --- a/nixos/modules/system/boot/stage-2-init.sh +++ b/nixos/modules/system/boot/stage-2-init.sh @@ -164,7 +164,9 @@ $systemConfig/activate # Restore the system time from the hardware clock. We do this after # running the activation script to be sure that /etc/localtime points # at the current time zone. -hwclock --hctosys +if [ -e /dev/rtc ]; then + hwclock --hctosys +fi # Record the boot configuration. -- cgit 1.4.1 From 0ab320a884f93fb98939a3f0ccc5ce8bd9d25da9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 11 May 2015 17:32:53 +0200 Subject: stage-1: Shut up warnings about swap devices that don't exist yet (cherry picked from commit 388dac478d21b743946362294043b83da4852721) --- nixos/modules/system/boot/stage-1-init.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index e8d276920a83..26cf7f06c9ed 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -182,9 +182,9 @@ if test -e /sys/power/resume -a -e /sys/power/disk; then for sd in @resumeDevices@; do # Try to detect resume device. According to Ubuntu bug: # https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/923326/comments/1 - # When there are multiple swap devices, we can't know where will hibernate - # image reside. We can check all of them for swsuspend blkid. - resumeInfo="$(udevadm info -q property "$sd" )" + # when there are multiple swap devices, we can't know where the hibernate + # image will reside. We can check all of them for swsuspend blkid. + resumeInfo="$(test -e "$d" && udevadm info -q property "$sd")" if [ "$(echo "$resumeInfo" | sed -n 's/^ID_FS_TYPE=//p')" = "swsuspend" ]; then resumeDev="$sd" break -- cgit 1.4.1 From 925e1f91c5a13649df193a47f37a6906b13e6a83 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 May 2015 18:19:34 +0200 Subject: Set up /etc/machine-id before starting systemd Otherwise, systemd will try to populate /etc, which we don't want. (cherry picked from commit c8501a421806c6526a12b2f6537ab38754e9d4ff) --- nixos/modules/system/boot/systemd.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 557dc204fca3..f6113188b030 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -646,6 +646,10 @@ in # groups, in addition to those in the systemd-journal group. # Users can always read their own journals. ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true + + if ! [ -e /etc/machine-id ]; then + ${systemd}/bin/systemd-machine-id-setup + fi ''; users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network; -- cgit 1.4.1 From 5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 31 May 2015 19:55:33 +0300 Subject: systemd: Use upstream tmpfiles.d rules This fixes a failing assert in systemd-timesyncd (issue #5913) as it expects the directory /run/systemd/netif/links/ to exist, and nothing in NixOS currently creates it. Also we get a net reduction in our code as rules for /run/utmp and /var/log/journal are also provided by the same upstream file. (cherry picked from commit a278a9224a3c1c5db399d53c86b36a25133b5cda) --- nixos/modules/system/activation/activation-script.nix | 4 ---- nixos/modules/system/boot/systemd.nix | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 2e5a70b3aa54..02b3e25a313d 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -114,10 +114,6 @@ in '' # Various log/runtime directories. - touch /run/utmp # must exist - chgrp ${toString config.ids.gids.utmp} /run/utmp - chmod 664 /run/utmp - mkdir -m 0755 -p /run/nix/current-load # for distributed builds mkdir -m 0700 -p /run/nix/remote-stores diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index f6113188b030..1314b7277723 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -639,13 +639,6 @@ in system.activationScripts.systemd = stringAfter [ "groups" ] '' mkdir -m 0755 -p /var/lib/udev - mkdir -p /var/log/journal - chmod 0755 /var/log/journal - - # Make all journals readable to users in the wheel and adm - # groups, in addition to those in the systemd-journal group. - # Users can always read their own journals. - ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true if ! [ -e /etc/machine-id ]; then ${systemd}/bin/systemd-machine-id-setup @@ -731,6 +724,7 @@ in startSession = true; }; + environment.etc."tmpfiles.d/systemd.conf".source = "${systemd}/example/tmpfiles.d/systemd.conf"; environment.etc."tmpfiles.d/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf"; environment.etc."tmpfiles.d/nixos.conf".text = @@ -738,10 +732,6 @@ in # This file is created automatically and should not be modified. # Please change the option ‘systemd.tmpfiles.rules’ instead. - z /var/log/journal 2755 root systemd-journal - - - z /var/log/journal/%m 2755 root systemd-journal - - - z /var/log/journal/%m/* 0640 root systemd-journal - - - ${concatStringsSep "\n" cfg.tmpfiles.rules} ''; -- cgit 1.4.1 From 6147909f8e80d7fbf15e73f556ee1f6ab4c93289 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 6 Jun 2015 14:15:24 +0300 Subject: extlinux-conf-builder: Properly copy kernels for the default entry When calling addEntry inside a subshell, the filesCopied array would be updated only in the subshell's environment. This would only cause an issue if no -g flag was passed to the script, causing no kernels to be copied. --- .../boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh index 8f2a496de8b6..9f32dbcce1a3 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh @@ -106,9 +106,10 @@ cat > $tmpFile <> $tmpFile + # Add up to $numGenerations generations of the system profile to the menu, # in reverse (most recent to least recent) order. for generation in $( -- cgit 1.4.1 From 8496f71e9219e1a5ea01898c1c306ab58cf6773a Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Thu, 18 Jun 2015 00:45:46 +0300 Subject: extlinux-conf-builder: Make it work on non-DTB systems With this, boot.loader.generic-extlinux-compatible can be used with linuxPackages_rpi on the Raspberry Pi. --- .../generic-extlinux-compatible/extlinux-conf-builder.nix | 3 ++- .../generic-extlinux-compatible/extlinux-conf-builder.sh | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix index 261192c6d24e..c5c250c14cea 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.nix @@ -3,6 +3,7 @@ pkgs.substituteAll { src = ./extlinux-conf-builder.sh; isExecutable = true; - inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; + inherit (pkgs) bash; + kernelDTB = pkgs.stdenv.platform.kernelDTB or false; } diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh index 9f32dbcce1a3..642bdf4673bd 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh @@ -75,8 +75,10 @@ addEntry() { copyToKernelsDir "$path/kernel"; kernel=$result copyToKernelsDir "$path/initrd"; initrd=$result - # XXX UGLY: maybe the system config should have a top-level "dtbs" entry? - copyToKernelsDir $(readlink -m "$path/kernel/../dtbs"); dtbs=$result + if [ -n "@kernelDTB@" ]; then + # XXX UGLY: maybe the system config should have a top-level "dtbs" entry? + copyToKernelsDir $(readlink -m "$path/kernel/../dtbs"); dtbs=$result + fi timestampEpoch=$(stat -L -c '%Z' $path) @@ -93,7 +95,9 @@ addEntry() { fi echo " LINUX ../nixos/$(basename $kernel)" echo " INITRD ../nixos/$(basename $initrd)" - echo " FDTDIR ../nixos/$(basename $dtbs)" + if [ -n "@kernelDTB@" ]; then + echo " FDTDIR ../nixos/$(basename $dtbs)" + fi echo " APPEND systemConfig=$path init=$path/init $extraParams" } -- cgit 1.4.1 From a6c95a3f7d2215965e098f404a9ad544a8fdd99c Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Fri, 19 Jun 2015 03:36:07 +0300 Subject: extlinux-conf-builder: Set menu title to force prompt display Without a menu title, U-Boot's distro scripts just autoboot the first entry by default. When I initially wrote this, my board wasn't apparently running stock U-Boot but had some local hacks saved in the U-Boot's environment which made it always display the prompt. --- .../boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh index 642bdf4673bd..7da9c488f690 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh @@ -109,6 +109,7 @@ cat > $tmpFile < Date: Sat, 25 Jul 2015 18:04:27 +0200 Subject: Fix description of boot.consoleLogLevel --- nixos/modules/installer/cd-dvd/iso-image.nix | 4 ++++ nixos/modules/system/boot/kernel.nix | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index c9abff2ecfc0..3712d3723d08 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -218,6 +218,8 @@ in system.boot.loader.kernelFile = "bzImage"; environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ]; + boot.consoleLogLevel = 7; + # In stage 1 of the boot, mount the CD as the root FS by label so # that we don't need to know its device. We pass the label of the # root filesystem on the kernel command line, rather than in @@ -229,6 +231,8 @@ in boot.kernelParams = [ "root=LABEL=${config.isoImage.volumeID}" "boot.shell_on_fail" + "nomodeset" + "systemd.log_level=debug" ]; fileSystems."/" = diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 63a095be6311..ae868219aa42 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -49,9 +49,8 @@ in type = types.int; default = 4; description = '' - The kernel console log level. Only log messages with a - priority numerically less than this will appear on the - console. + The kernel console log level. Log messages with a priority + numerically less than this will not appear on the console. ''; }; -- cgit 1.4.1 From c49b24c94004807f3de5eef9535d2d50d184dbd6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 25 Jul 2015 18:54:26 +0200 Subject: Fix capitalisation --- nixos/modules/system/boot/loader/grub/grub.nix | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index c7cf712e3c2b..0b349749244f 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -10,7 +10,7 @@ let realGrub = if cfg.version == 1 then pkgs.grub else if cfg.zfsSupport then pkgs.grub2.override { zfsSupport = true; } - else if cfg.enableTrustedboot then pkgs.trustedGrub + else if cfg.enableTrustedBoot then pkgs.trustedGrub else pkgs.grub2; grub = @@ -112,7 +112,7 @@ in description = '' The devices on which the boot loader, GRUB, will be installed. Can be used instead of device to - install grub into multiple devices (e.g., if as softraid arrays holding /boot). + install GRUB onto multiple devices. ''; }; @@ -135,8 +135,8 @@ in example = "/boot1"; type = types.str; description = '' - The path to the boot directory where grub will be written. Generally - this boot parth should double as an efi path. + The path to the boot directory where GRUB will be written. Generally + this boot path should double as an EFI path. ''; }; @@ -166,7 +166,7 @@ in example = [ "/dev/sda" "/dev/sdb" ]; type = types.listOf types.str; description = '' - The path to the devices which will have the grub mbr written. + The path to the devices which will have the GRUB MBR written. Note these are typically device paths and not paths to partitions. ''; }; @@ -197,7 +197,7 @@ in type = types.lines; description = '' Additional bash commands to be run at the script that - prepares the grub menu entries. + prepares the GRUB menu entries. ''; }; @@ -276,7 +276,7 @@ in example = "1024x768"; type = types.str; description = '' - The gfxmode to pass to grub when loading a graphical boot interface under efi. + The gfxmode to pass to GRUB when loading a graphical boot interface under EFI. ''; }; @@ -285,7 +285,7 @@ in example = "auto"; type = types.str; description = '' - The gfxmode to pass to grub when loading a graphical boot interface under bios. + The gfxmode to pass to GRUB when loading a graphical boot interface under BIOS. ''; }; @@ -330,10 +330,10 @@ in type = types.addCheck types.str (type: type == "uuid" || type == "label" || type == "provided"); description = '' - Determines how grub will identify devices when generating the + Determines how GRUB will identify devices when generating the configuration file. A value of uuid / label signifies that grub will always resolve the uuid or label of the device before using - it in the configuration. A value of provided means that grub will + it in the configuration. A value of provided means that GRUB will use the device name as show in df or mount. Note, zfs zpools / datasets are ignored and will always be mounted using their labels. @@ -344,7 +344,7 @@ in default = false; type = types.bool; description = '' - Whether grub should be build against libzfs. + Whether GRUB should be build against libzfs. ZFS support is only available for GRUB v2. This option is ignored for GRUB v1. ''; @@ -354,7 +354,7 @@ in default = false; type = types.bool; description = '' - Whether grub should be build with EFI support. + Whether GRUB should be build with EFI support. EFI support is only available for GRUB v2. This option is ignored for GRUB v1. ''; @@ -364,16 +364,16 @@ in default = false; type = types.bool; description = '' - Enable support for encrypted partitions. Grub should automatically + Enable support for encrypted partitions. GRUB should automatically unlock the correct encrypted partition and look for filesystems. ''; }; - enableTrustedboot = mkOption { + enableTrustedBoot = mkOption { default = false; type = types.bool; description = '' - Enable trusted boot. Grub will measure all critical components during + Enable trusted boot. GRUB will measure all critical components during the boot process to offer TCG (TPM) support. ''; }; @@ -429,7 +429,7 @@ in assertions = [ { assertion = !cfg.zfsSupport || cfg.version == 2; - message = "Only grub version 2 provides zfs support"; + message = "Only GRUB version 2 provides ZFS support"; } { assertion = cfg.mirroredBoots != [ ]; @@ -441,19 +441,19 @@ in message = "You cannot have duplicated devices in mirroredBoots"; } { - assertion = !cfg.enableTrustedboot || cfg.version == 2; + assertion = !cfg.enableTrustedBoot || cfg.version == 2; message = "Trusted GRUB is only available for GRUB 2"; } { - assertion = !cfg.efiSupport || !cfg.enableTrustedboot; + assertion = !cfg.efiSupport || !cfg.enableTrustedBoot; message = "Trusted GRUB does not have EFI support"; } { - assertion = !cfg.zfsSupport || !cfg.enableTrustedboot; + assertion = !cfg.zfsSupport || !cfg.enableTrustedBoot; message = "Trusted GRUB does not have ZFS support"; } { - assertion = !cfg.enableTrustedboot; + assertion = !cfg.enableTrustedBoot; message = "Trusted GRUB can break your system. Remove assertion if you want to test trustedGRUB nevertheless."; } ] ++ flip concatMap cfg.mirroredBoots (args: [ @@ -471,7 +471,7 @@ in } ] ++ flip map args.devices (device: { assertion = device == "nodev" || hasPrefix "/" device; - message = "Grub devices must be absolute paths, not ${dev} in ${args.path}"; + message = "GRUB devices must be absolute paths, not ${dev} in ${args.path}"; })); }) -- cgit 1.4.1 From 8665b0d8b10dc612b9b3dd5174837278026739e4 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 25 Jul 2015 23:57:55 +0300 Subject: extlinux-conf-builder: Fix warning when building in chroot When using extlinux-conf-builder in a nix build using chroots, the following error message could be seen: /nix/store/XXX-extlinux-conf-builder.sh: line 121: cd: /nix/var/nix/profiles: No such file or directory To avoid this, just skip the code path parsing /nix/var/nix/profiles when $numGenerations (passed from the command line) is 0 (which is the only legal value of $numGenerations in a nix build context). --- .../extlinux-conf-builder.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh index 7da9c488f690..b9a42b2a196d 100644 --- a/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh +++ b/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh @@ -115,16 +115,18 @@ EOF addEntry $default default >> $tmpFile -# Add up to $numGenerations generations of the system profile to the menu, -# in reverse (most recent to least recent) order. -for generation in $( - (cd /nix/var/nix/profiles && ls -d system-*-link) \ - | sed 's/system-\([0-9]\+\)-link/\1/' \ - | sort -n -r \ - | head -n $numGenerations); do - link=/nix/var/nix/profiles/system-$generation-link - addEntry $link $generation -done >> $tmpFile +if [ "$numGenerations" -gt 0 ]; then + # Add up to $numGenerations generations of the system profile to the menu, + # in reverse (most recent to least recent) order. + for generation in $( + (cd /nix/var/nix/profiles && ls -d system-*-link) \ + | sed 's/system-\([0-9]\+\)-link/\1/' \ + | sort -n -r \ + | head -n $numGenerations); do + link=/nix/var/nix/profiles/system-$generation-link + addEntry $link $generation + done >> $tmpFile +fi mv -f $tmpFile $target/extlinux/extlinux.conf -- cgit 1.4.1 From f07b2121f9dc23f6a69bbc815e7991c7f52fe551 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Jul 2015 01:07:13 +0200 Subject: Fix grub-reboot --- nixos/modules/system/boot/loader/grub/install-grub.pl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index 34bff727b73a..af39e50ff72d 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -237,6 +237,7 @@ else { $conf .= " " . $grubStore->search; } + # FIXME: should use grub-mkconfig. $conf .= " " . $grubBoot->search . " if [ -s \$prefix/grubenv ]; then @@ -245,14 +246,12 @@ else { # ‘grub-reboot’ sets a one-time saved entry, which we process here and # then delete. - if [ \"\${saved_entry}\" ]; then - # The next line *has* to look exactly like this, otherwise KDM's - # reboot feature won't work properly with GRUB 2. + if [ \"\${next_entry}\" ]; then + # FIXME: KDM expects the next line to be present. set default=\"\${saved_entry}\" - set saved_entry= - set prev_saved_entry= - save_env saved_entry - save_env prev_saved_entry + set default=\"\${next_entry}\" + set next_entry= + save_env next_entry set timeout=1 else set default=$defaultEntry -- cgit 1.4.1 From 2a31397f536b3bf57e4ee76b812fd83ab31de971 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 30 Jul 2015 16:29:38 -0500 Subject: stage-1: fix typo that breaks resume $d should be $sd, this causes resume from hibernate to fail if resumeDevice is not explicitly set in config. Introduced in commit: 'stage-1: Shut up warnings about swap devices that don't exist yet' --- nixos/modules/system/boot/stage-1-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 26cf7f06c9ed..480bbfa2b07b 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -184,7 +184,7 @@ if test -e /sys/power/resume -a -e /sys/power/disk; then # https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/923326/comments/1 # when there are multiple swap devices, we can't know where the hibernate # image will reside. We can check all of them for swsuspend blkid. - resumeInfo="$(test -e "$d" && udevadm info -q property "$sd")" + resumeInfo="$(test -e "$sd" && udevadm info -q property "$sd")" if [ "$(echo "$resumeInfo" | sed -n 's/^ID_FS_TYPE=//p')" = "swsuspend" ]; then resumeDev="$sd" break -- cgit 1.4.1 From 57f7798b51b9bf775f22428d70b1dca0b01cf032 Mon Sep 17 00:00:00 2001 From: Anders Papitto Date: Thu, 20 Aug 2015 23:45:13 -0700 Subject: also generate startAt timers for systemd user units --- nixos/modules/system/boot/systemd.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 1314b7277723..05369da4f16b 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -713,6 +713,14 @@ in }) (filterAttrs (name: service: service.startAt != "") cfg.services); + # Generate timer units for all services that have a ‘startAt’ value. + systemd.user.timers = + mapAttrs (name: service: + { wantedBy = [ "timers.target" ]; + timerConfig.OnCalendar = service.startAt; + }) + (filterAttrs (name: service: service.startAt != "") cfg.user.services); + systemd.sockets.systemd-journal-gatewayd.wantedBy = optional config.services.journald.enableHttpGateway "sockets.target"; -- cgit 1.4.1 From 9c61317002edf32812d793aebac86a990edcd1cb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Aug 2015 00:27:06 +0200 Subject: Put all firmware in $out/lib/firmware This way, hardware.firmware can be a list of packages. --- nixos/modules/hardware/all-firmware.nix | 4 +--- .../modules/hardware/video/encoder/wis-go7007.nix | 8 ++++---- nixos/modules/services/hardware/udev.nix | 22 ++++++++++------------ nixos/modules/system/activation/top-level.nix | 2 +- nixos/modules/system/boot/kernel.nix | 2 +- .../linux/firmware/b43-firmware/5.1.138.nix | 4 ++-- pkgs/os-specific/linux/firmware/zd1211/default.nix | 8 ++++---- pkgs/os-specific/linux/wis-go7007/default.nix | 2 +- 8 files changed, 24 insertions(+), 28 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index e4bdeb55cadc..1a04baef1930 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -22,9 +22,7 @@ with lib; ###### implementation config = mkIf config.hardware.enableAllFirmware { - hardware.firmware = [ - "${pkgs.firmwareLinuxNonfree}/lib/firmware" - ]; + hardware.firmware = [ pkgs.firmwareLinuxNonfree ]; }; } diff --git a/nixos/modules/hardware/video/encoder/wis-go7007.nix b/nixos/modules/hardware/video/encoder/wis-go7007.nix index c0eb2b814b33..e9b3cf72a8dd 100644 --- a/nixos/modules/hardware/video/encoder/wis-go7007.nix +++ b/nixos/modules/hardware/video/encoder/wis-go7007.nix @@ -5,11 +5,11 @@ let in { - boot.extraModulePackages = [wis_go7007]; + boot.extraModulePackages = [ wis_go7007 ]; - environment.systemPackages = [wis_go7007]; + environment.systemPackages = [ wis_go7007 ]; - hardware.firmware = ["${wis_go7007}/firmware"]; + hardware.firmware = [ wis_go7007 ]; - services.udev.packages = [wis_go7007]; + services.udev.packages = [ wis_go7007 ]; } diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index fc89de777e8e..513eb27b4069 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -171,25 +171,23 @@ in }; hardware.firmware = mkOption { - type = types.listOf types.path; + type = types.listOf types.package; default = []; description = '' - List of directories containing firmware files. Such files + List of packages containing firmware files. Such files will be loaded automatically if the kernel asks for them (i.e., when it has detected specific hardware that requires - firmware to function). If more than one path contains a - firmware file with the same name, the first path in the list - takes precedence. Note that you must rebuild your system if - you add files to any of these directories. For quick testing, + firmware to function). If multiple packages contain firmware + files with the same name, the first package in the list takes + precedence. Note that you must rebuild your system if you add + files to any of these directories. For quick testing, put firmware files in /root/test-firmware - and add that directory to the list. Note that you can also - add firmware packages to this list as these are directories in - the nix store. + and add that directory to the list. ''; apply = list: pkgs.buildEnv { name = "firmware"; paths = list; - pathsToLink = [ "/" ]; + pathsToLink = [ "/lib/firmware" ]; ignoreCollisions = true; }; }; @@ -236,7 +234,7 @@ in (isYes "NET") ]; - boot.extraModprobeConfig = "options firmware_class path=${config.hardware.firmware}"; + boot.extraModprobeConfig = "options firmware_class path=${config.hardware.firmware}/lib/firmware"; system.activationScripts.udevd = '' @@ -254,7 +252,7 @@ in # Allow the kernel to find our firmware. if [ -e /sys/module/firmware_class/parameters/path ]; then - echo -n "${config.hardware.firmware}" > /sys/module/firmware_class/parameters/path + echo -n "${config.hardware.firmware}/lib/firmware" > /sys/module/firmware_class/parameters/path fi ''; diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 839300798167..a977ddb7bb4d 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -50,7 +50,7 @@ let ln -s ${config.system.build.initialRamdisk}/initrd $out/initrd - ln -s ${config.hardware.firmware} $out/firmware + ln -s ${config.hardware.firmware}/lib/firmware $out/firmware ''} echo "$activationScript" > $out/activate diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index ae868219aa42..ac40e8a49acf 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -216,7 +216,7 @@ in ]; # The Linux kernel >= 2.6.27 provides firmware. - hardware.firmware = [ "${kernel}/lib/firmware" ]; + hardware.firmware = [ kernel ]; # Create /etc/modules-load.d/nixos.conf, which is read by # systemd-modules-load.service to load required kernel modules. diff --git a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix index 436f40712fc2..1cc0e7ae4ca7 100644 --- a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix +++ b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation { phases = [ "unpackPhase" "installPhase" ]; installPhase = '' - mkdir $out - b43-fwcutter -w $out linux/wl_apsta.o + mkdir -p $out/lib/firmware + b43-fwcutter -w $out/lib/firmware linux/wl_apsta.o ''; meta = { diff --git a/pkgs/os-specific/linux/firmware/zd1211/default.nix b/pkgs/os-specific/linux/firmware/zd1211/default.nix index 96e534e3b805..19cbdecca0cc 100644 --- a/pkgs/os-specific/linux/firmware/zd1211/default.nix +++ b/pkgs/os-specific/linux/firmware/zd1211/default.nix @@ -5,16 +5,16 @@ stdenv.mkDerivation rec { version = "1.5"; name = "${pname}-${version}"; - + src = fetchurl { url = "mirror://sourceforge/zd1211/${name}.tar.bz2"; sha256 = "04ibs0qw8bh6h6zmm5iz6lddgknwhsjq8ib3gyck6a7psw83h7gi"; }; - + buildPhase = "true"; - installPhase = "mkdir -p $out/zd1211; cp * $out/zd1211"; - + installPhase = "mkdir -p $out/lib/firmware/zd1211; cp * $out/lib/firmware/zd1211"; + meta = { description = "Firmware for the ZyDAS ZD1211(b) 802.11a/b/g USB WLAN chip"; homepage = http://sourceforge.net/projects/zd1211/; diff --git a/pkgs/os-specific/linux/wis-go7007/default.nix b/pkgs/os-specific/linux/wis-go7007/default.nix index 538686720257..4dae68d4871e 100644 --- a/pkgs/os-specific/linux/wis-go7007/default.nix +++ b/pkgs/os-specific/linux/wis-go7007/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation { mkdir -p $out/etc/udev/rules.d makeFlagsArray=(KERNELSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source \ - FIRMWARE_DIR=$out/firmware FXLOAD=${fxload}/sbin/fxload \ + FIRMWARE_DIR=$out/lib/firmware FXLOAD=${fxload}/sbin/fxload \ DESTDIR=$out SKIP_DEPMOD=1 \ USE_UDEV=y) ''; # */ -- cgit 1.4.1 From e4610f2965c2ab60132344defa055792a658ea45 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Aug 2015 00:37:54 +0200 Subject: buildEnv: Support package priorities like nix-env This gets rid of a bunch of collision warnings. --- nixos/modules/system/boot/modprobe.nix | 1 + pkgs/build-support/buildenv/builder.pl | 70 +++++++++++++--------- pkgs/build-support/buildenv/default.nix | 10 +++- .../firmware/firmware-linux-nonfree/default.nix | 1 + pkgs/os-specific/linux/nvidia-x11/default.nix | 1 + pkgs/os-specific/linux/util-linux/default.nix | 1 + pkgs/tools/archivers/cpio/default.nix | 1 + 7 files changed, 53 insertions(+), 32 deletions(-) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index a3b616ff3eff..c49380899664 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -35,6 +35,7 @@ with lib; fi ''; + meta.priority = 4; }; description = '' Wrapper around modprobe that sets the path to the modules diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index 08331b178f4f..798fca6572ea 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -5,6 +5,7 @@ use Cwd 'abs_path'; use IO::Handle; use File::Path; use File::Basename; +use JSON::PP; STDOUT->autoflush(1); @@ -17,7 +18,7 @@ sub isInPathsToLink { $path = "/" if $path eq ""; foreach my $elem (@pathsToLink) { return 1 if - $elem eq "/" || + $elem eq "/" || (substr($path, 0, length($elem)) eq $elem && (($path eq $elem) || (substr($path, length($elem), 1) eq "/"))); } @@ -28,25 +29,27 @@ sub isInPathsToLink { # For each activated package, determine what symlinks to create. my %symlinks; -$symlinks{""} = ""; # create root directory +$symlinks{""} = ["", 0]; # create root directory + +my %priorities; sub findFiles; sub findFilesInDir { - my ($relName, $target, $ignoreCollisions) = @_; + my ($relName, $target, $ignoreCollisions, $priority) = @_; opendir DIR, "$target" or die "cannot open `$target': $!"; my @names = readdir DIR or die; closedir DIR; - + foreach my $name (@names) { next if $name eq "." || $name eq ".."; - findFiles("$relName/$name", "$target/$name", $name, $ignoreCollisions); + findFiles("$relName/$name", "$target/$name", $name, $ignoreCollisions, $priority); } } - + sub findFiles { - my ($relName, $target, $baseName, $ignoreCollisions) = @_; + my ($relName, $target, $baseName, $ignoreCollisions, $priority) = @_; # Urgh, hacky... return if @@ -57,41 +60,48 @@ sub findFiles { $baseName eq "perllocal.pod" || $baseName eq "log"; - my $oldTarget = $symlinks{$relName}; + my ($oldTarget, $oldPriority) = @{$symlinks{$relName} // [undef, undef]}; - if (!defined $oldTarget) { - $symlinks{$relName} = $target; + # If target doesn't exist, create it. If it already exists as a + # symlink to a file (not a directory) in a lower-priority package, + # overwrite it. + if (!defined $oldTarget || ($priority < $oldPriority && ($oldTarget ne "" && ! -d $oldTarget))) { + $symlinks{$relName} = [$target, $priority]; + return; + } + + # If target already exists as a symlink to a file (not a + # directory) in a higher-priority package, skip. + if (defined $oldTarget && $priority > $oldPriority && $oldTarget ne "" && ! -d $oldTarget) { return; } unless (-d $target && ($oldTarget eq "" || -d $oldTarget)) { if ($ignoreCollisions) { - warn "collision between `$target' and `$oldTarget'" if $ignoreCollisions == 1; + warn "collision between `$target' and `$oldTarget'\n" if $ignoreCollisions == 1; return; } else { - die "collision between `$target' and `$oldTarget'"; + die "collision between `$target' and `$oldTarget'\n"; } } - findFilesInDir($relName, $oldTarget, $ignoreCollisions) unless $oldTarget eq ""; - findFilesInDir($relName, $target, $ignoreCollisions); - - $symlinks{$relName} = ""; # denotes directory + findFilesInDir($relName, $oldTarget, $ignoreCollisions, $oldPriority) unless $oldTarget eq ""; + findFilesInDir($relName, $target, $ignoreCollisions, $priority); + + $symlinks{$relName} = ["", $priority]; # denotes directory } my %done; my %postponed; -sub addPkg; -sub addPkg($;$) { - my $pkgDir = shift; - my $ignoreCollisions = shift; +sub addPkg { + my ($pkgDir, $ignoreCollisions, $priority) = @_; return if (defined $done{$pkgDir}); $done{$pkgDir} = 1; - findFiles("", "$pkgDir", "", $ignoreCollisions); + findFiles("", $pkgDir, "", $ignoreCollisions, $priority); my $propagatedFN = "$pkgDir/nix-support/propagated-user-env-packages"; if (-e $propagatedFN) { @@ -106,23 +116,25 @@ sub addPkg($;$) { } -# Symlink to the packages that have been installed explicitly by the user. -my @args = split ' ', $ENV{"paths"}; - -foreach my $pkgDir (@args) { - addPkg($pkgDir, $ENV{"ignoreCollisions"} eq "1") if -e $pkgDir; +# Symlink to the packages that have been installed explicitly by the +# user. +for my $pkg (@{decode_json $ENV{"pkgs"}}) { + for my $path (@{$pkg->{paths}}) { + addPkg($path, $ENV{"ignoreCollisions"} eq "1", $pkg->{priority}) if -e $path; + } } # Symlink to the packages that have been "propagated" by packages -# installed by the user (i.e., package X declares that it want Y +# installed by the user (i.e., package X declares that it wants Y # installed as well). We do these later because they have a lower # priority in case of collisions. +my $priorityCounter = 1000; # don't care about collisions while (scalar(keys %postponed) > 0) { my @pkgDirs = keys %postponed; %postponed = (); foreach my $pkgDir (sort @pkgDirs) { - addPkg($pkgDir, 2); + addPkg($pkgDir, 2, $priorityCounter++); } } @@ -130,7 +142,7 @@ while (scalar(keys %postponed) > 0) { # Create the symlinks. my $nrLinks = 0; foreach my $relName (sort keys %symlinks) { - my $target = $symlinks{$relName}; + my ($target, $priority) = @{$symlinks{$relName}}; my $abs = "$out/$relName"; next unless isInPathsToLink $relName; if ($target eq "") { diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 293291dc1dad..2ae8123faca4 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -9,10 +9,10 @@ , # The manifest file (if any). A symlink $out/manifest will be # created to it. manifest ? "" - + , # The paths to symlink. paths - + , # Whether to ignore collisions or abort. ignoreCollisions ? false @@ -28,7 +28,11 @@ }: runCommand name - { inherit manifest paths ignoreCollisions passthru pathsToLink postBuild; + { inherit manifest ignoreCollisions passthru pathsToLink postBuild; + pkgs = builtins.toJSON (map (drv: { + paths = [ drv ]; # FIXME: handle multiple outputs + priority = drv.meta.priority or 5; + }) paths); preferLocalBuild = true; } '' diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix index 259c5acdf873..a995b193a845 100644 --- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix +++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix @@ -30,6 +30,7 @@ stdenv.mkDerivation rec { license = licenses.unfreeRedistributableFirmware; platforms = platforms.linux; maintainers = with maintainers; [ wkennington ]; + priority = 6; # give precedence to kernel firmware }; passthru = { inherit version; }; diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index ab564c10e2e5..cbd9a19777e5 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -63,5 +63,6 @@ stdenv.mkDerivation { license = licenses.unfreeRedistributable; platforms = platforms.linux; maintainers = [ maintainers.vcunat ]; + priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so" }; } diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 7f2aeca255c8..7768875ca57f 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -53,5 +53,6 @@ stdenv.mkDerivation rec { homepage = http://www.kernel.org/pub/linux/utils/util-linux/; description = "A set of system utilities for Linux"; platforms = stdenv.lib.platforms.linux; + priority = 6; # lower priority than coreutils ("kill") and shadow ("login" etc.) packages }; } diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix index 2cd65391216d..f2207b588499 100644 --- a/pkgs/tools/archivers/cpio/default.nix +++ b/pkgs/tools/archivers/cpio/default.nix @@ -35,5 +35,6 @@ stdenv.mkDerivation { homepage = http://www.gnu.org/software/cpio/; description = "A program to create or extract from cpio archives"; platforms = stdenv.lib.platforms.all; + priority = 6; # resolves collision with gnutar's "libexec/rmt" }; } -- cgit 1.4.1 From 6ab7e0de2953b5d13f52372258825e90fdea3fd3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Sep 2015 11:29:46 +0200 Subject: Create /var/log/journal Fixes #9614. --- nixos/modules/system/boot/systemd.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/system/boot') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 05369da4f16b..4976dfe8eea4 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -643,6 +643,10 @@ in if ! [ -e /etc/machine-id ]; then ${systemd}/bin/systemd-machine-id-setup fi + + # Keep a persistent journal. Note that systemd-tmpfiles will + # set proper ownership/permissions. + mkdir -m 0700 -p /var/log/journal ''; users.extraUsers.systemd-network.uid = config.ids.uids.systemd-network; -- cgit 1.4.1