summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-12-18 17:08:04 -0500
committerShea Levy <shea@shealevy.com>2014-12-18 17:08:04 -0500
commite3825b47ec76b2178321bb9da362f7308076b902 (patch)
tree856775c1bb17bbf0ebd15e2d9894e04b0f6a2579 /pkgs/os-specific/linux/systemd
parentefb2b27a8fb698ed19e07e44686b782a9a619174 (diff)
downloadnixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar.gz
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar.bz2
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar.lz
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar.xz
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.tar.zst
nixlib-e3825b47ec76b2178321bb9da362f7308076b902.zip
systemd: read units from /etc/systemd-mutable
This allows for persistent units managed outside of configuration.nix
Diffstat (limited to 'pkgs/os-specific/linux/systemd')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix3
-rw-r--r--pkgs/os-specific/linux/systemd/etc-systemd-mutable.patch41
2 files changed, 44 insertions, 0 deletions
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",