From e3825b47ec76b2178321bb9da362f7308076b902 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 18 Dec 2014 17:08:04 -0500 Subject: systemd: read units from /etc/systemd-mutable This allows for persistent units managed outside of configuration.nix --- pkgs/os-specific/linux/systemd/default.nix | 3 ++ .../linux/systemd/etc-systemd-mutable.patch | 41 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/os-specific/linux/systemd/etc-systemd-mutable.patch (limited to 'pkgs/os-specific/linux/systemd') diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 2df23cf0e16e..dda39e3e1305 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -25,6 +25,9 @@ stdenv.mkDerivation rec { # Fixes systemd-journald so that it does not get killed # by systemd-journal-flush starting too quickly ./systemd-journald-type-notify.patch + # Enables /etc/systemd-mutable/{system,user} for persistent mutable + # units + ./etc-systemd-mutable.patch ]; buildInputs = diff --git a/pkgs/os-specific/linux/systemd/etc-systemd-mutable.patch b/pkgs/os-specific/linux/systemd/etc-systemd-mutable.patch new file mode 100644 index 000000000000..b55680164444 --- /dev/null +++ b/pkgs/os-specific/linux/systemd/etc-systemd-mutable.patch @@ -0,0 +1,41 @@ +diff -Naur systemd-217-orig/src/core/systemd.pc.in systemd-217/src/core/systemd.pc.in +--- systemd-217-orig/src/core/systemd.pc.in 2014-06-30 17:19:00.693878016 -0400 ++++ systemd-217/src/core/systemd.pc.in 2014-12-18 12:32:04.978371150 -0500 +@@ -14,8 +14,8 @@ + systemduserpresetdir=@userpresetdir@ + systemdsystemconfdir=@pkgsysconfdir@/system + systemduserconfdir=@pkgsysconfdir@/user +-systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemdsystemunitdir}:/usr/lib/systemd/system:/lib/systemd/system +-systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemduserunitdir}:/usr/lib/systemd/user:/usr/share/systemd/user ++systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/etc/systemd-mutable/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemdsystemunitdir}:/usr/lib/systemd/system:/lib/systemd/system ++systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/etc/systemd-mutable/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemduserunitdir}:/usr/lib/systemd/user:/usr/share/systemd/user + systemdsystemgeneratordir=@systemgeneratordir@ + systemdusergeneratordir=@usergeneratordir@ + systemdsleepdir=@systemsleepdir@ +diff -Naur systemd-217-orig/src/shared/path-lookup.c systemd-217/src/shared/path-lookup.c +--- systemd-217-orig/src/shared/path-lookup.c 2014-10-07 09:59:01.480569950 -0400 ++++ systemd-217/src/shared/path-lookup.c 2014-12-18 12:29:36.276567200 -0500 +@@ -86,6 +86,7 @@ + const char * const config_unit_paths[] = { + USER_CONFIG_UNIT_PATH, + "/etc/systemd/user", ++ "/etc/systemd-mutable/user", + NULL + }; + +@@ -260,6 +261,7 @@ + STRV_IFNOTNULL(generator_early), + USER_CONFIG_UNIT_PATH, + "/etc/systemd/user", ++ "/etc/systemd-mutable/user", + "/run/systemd/user", + STRV_IFNOTNULL(generator), + "/usr/local/lib/systemd/user", +@@ -276,6 +278,7 @@ + STRV_IFNOTNULL(generator_early), + SYSTEM_CONFIG_UNIT_PATH, + "/etc/systemd/system", ++ "/etc/systemd-mutable/system", + "/run/systemd/system", + STRV_IFNOTNULL(generator), + "/usr/local/lib/systemd/system", -- cgit 1.4.1