From cdc746ff13296f064ca6e0a09e689df3fa8dab59 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 8 Feb 2026 16:41:48 +0100 Subject: [PATCH] systemd: drop 0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch Instead set this variable via CFLAGS. --- ...-execute-scripts-in-etc-systemd-syst.patch | 23 ------------------- pkgs/os-specific/linux/systemd/default.nix | 8 +++++-- 2 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 pkgs/os-specific/linux/systemd/0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch diff --git a/pkgs/os-specific/linux/systemd/0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch b/pkgs/os-specific/linux/systemd/0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch deleted file mode 100644 index 5de6a93cd7f9..000000000000 --- a/pkgs/os-specific/linux/systemd/0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nikolay Amiantov -Date: Thu, 25 Jul 2019 20:45:55 +0300 -Subject: [PATCH] systemd-shutdown: execute scripts in - /etc/systemd/system-shutdown - -This is needed for NixOS to use such scripts as systemd directory is immutable. ---- - src/shutdown/shutdown.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c -index fc6df238be..cb8b45a41b 100644 ---- a/src/shutdown/shutdown.c -+++ b/src/shutdown/shutdown.c -@@ -330,6 +330,7 @@ static void notify_supervisor(void) { - int main(int argc, char *argv[]) { - static const char* const dirs[] = { - SYSTEM_SHUTDOWN_PATH, -+ "/etc/systemd/system-shutdown", - NULL - }; - _cleanup_free_ char *cgroup = NULL; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 812d7227a48c..67c27eee878c 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -240,7 +240,6 @@ stdenv.mkDerivation (finalAttrs: { ./0002-Don-t-try-to-unmount-nix-or-nix-store.patch ./0007-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch ./0009-add-rootprefix-to-lookup-dir-paths.patch - ./0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch ./0011-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch ./0012-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch ./0013-inherit-systemd-environment-when-calling-generators.patch @@ -707,12 +706,17 @@ stdenv.mkDerivation (finalAttrs: { # warning messages postConfigure = '' substituteInPlace config.h \ - --replace-fail "SYSTEMD_BINARY_PATH" "_SYSTEMD_BINARY_PATH" + --replace-fail "SYSTEMD_BINARY_PATH" "_SYSTEMD_BINARY_PATH" \ + --replace-fail "SYSTEM_SHUTDOWN_PATH" "_SYSTEM_SHUTDOWN_PATH" ''; env.NIX_CFLAGS_COMPILE = toString [ "-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\"" + + # This path is not exposed via meson + "-USYSTEM_SHUTDOWN_PATH" + "-DSYSTEM_SHUTDOWN_PATH=\"/etc/systemd/system-shutdown\"" ]; doCheck = false;