From e37941e4e4d76f00b34cf3d1c68ee9ff57bfe1ed Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 12 Aug 2020 19:38:14 +0200 Subject: nixos/systemd: don't try to install systemd-initctl.{service,socket} Since systemd 246, these are only installed by systemd if HAVE_SYSV_COMPAT is true, which only is the case if you set sysvinit-path and sysvrcnd-path (which we explicitly unset in the systemd derivation for quite some time) --- nixos/modules/system/boot/systemd.nix | 4 ---- 1 file changed, 4 deletions(-) (limited to 'nixos/modules/system/boot/systemd.nix') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index d95f001a225..fbba999d071 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -81,10 +81,6 @@ let "systemd-coredump.socket" "systemd-coredump@.service" - # SysV init compatibility. - "systemd-initctl.socket" - "systemd-initctl.service" - # Kernel module loading. "systemd-modules-load.service" "kmod-static-nodes.service" -- cgit 1.4.1 From 3937923f81b08de1e7f8593ca62d05b8337daaaf Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Sun, 16 Aug 2020 10:14:21 +0200 Subject: nixos/systemd.tmpfiles.packages: fix an edge case symlinkJoin can break (silently) when the passed paths contain symlinks to directories. This should work now. Down-side: when lib/tmpfiles.d doesn't exist for some passed package, the error message is a little less explicit, because we never get to the postBuild phase (and symlinkJoin doesn't provide a better way): /nix/store/HASH-NAME/lib/tmpfiles.d: No such file or directory Also, it seemed pointless to create symlinks for whole package trees and using only a part of the result (usually very small part). --- nixos/modules/system/boot/systemd.nix | 10 +++++----- pkgs/build-support/trivial-builders.nix | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'nixos/modules/system/boot/systemd.nix') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index d95f001a225..77a54de4ade 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -1012,18 +1012,18 @@ in "sysctl.d/50-coredump.conf".source = "${systemd}/example/sysctl.d/50-coredump.conf"; "sysctl.d/50-default.conf".source = "${systemd}/example/sysctl.d/50-default.conf"; - "tmpfiles.d".source = (pkgs.symlinkJoin { + "tmpfiles.d".source = pkgs.symlinkJoin { name = "tmpfiles.d"; - paths = cfg.tmpfiles.packages; + paths = map (p: p + "/lib/tmpfiles.d") cfg.tmpfiles.packages; postBuild = '' for i in $(cat $pathsPath); do - (test -d $i/lib/tmpfiles.d && test $(ls $i/lib/tmpfiles.d/*.conf | wc -l) -ge 1) || ( - echo "ERROR: The path $i was passed to systemd.tmpfiles.packages but either does not contain the folder lib/tmpfiles.d or if it contains that folder, there are no files ending in .conf in it." + (test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || ( + echo "ERROR: The path '$i' from systemd.tmpfiles.packages contains no *.conf files." exit 1 ) done ''; - }) + "/lib/tmpfiles.d"; + }; "systemd/system-generators" = { source = hooks "generators" cfg.generators; }; "systemd/system-shutdown" = { source = hooks "shutdown" cfg.shutdown; }; diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 3c81a4ece65..eab5366e183 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -240,6 +240,8 @@ rec { * This creates a single derivation that replicates the directory structure * of all the input paths. * + * BEWARE: it may not "work right" when the passed paths contain symlinks to directories. + * * Examples: * # adds symlinks of hello to current build. * symlinkJoin { name = "myhello"; paths = [ pkgs.hello ]; } -- cgit 1.4.1