systemd: drop /etc/systemd-mutable

This has only been used by Dysnomia, which has been removed from Nixpkgs
in https://github.com/NixOS/nixpkgs/pull/110799 after being broken for
more than a year.

If Dysnomia comes back, it can probably just use
/nix/var/nix/profiles/default/lib/systemd/system, or set its own systemd
flavour looking in that location via the `systemd.package`.

+16 -26
+16 -26
pkgs/os-specific/linux/systemd/0005-Add-some-NixOS-specific-unit-directories.patch
··· 1 - From 6ede8baac88aba769030f5bc5f5b2070098c7428 Mon Sep 17 00:00:00 2001 1 + From 95e4533f1eeb6e0d509f9129d0133f0b849cc3c5 Mon Sep 17 00:00:00 2001 2 2 From: Eelco Dolstra <eelco.dolstra@logicblox.com> 3 3 Date: Fri, 19 Dec 2014 14:46:17 +0100 4 4 Subject: [PATCH 05/18] Add some NixOS-specific unit directories 5 5 6 - Look in `/nix/var/nix/profiles/default/lib/systemd` for units provided 7 - by packages installed into the default profile via 8 - `nix-env -iA nixos.$package`, and into `/etc/systemd-mutable/system` for 9 - persistent, mutable units (used for Dysnomia). 6 + Look in `/nix/var/nix/profiles/default/lib/systemd/{system,user}` for 7 + units provided by packages installed into the default profile via 8 + `nix-env -iA nixos.$package`. 10 9 11 10 Also, remove /usr and /lib as these don't exist on NixOS. 12 11 --- 13 - src/basic/path-lookup.c | 20 +++++--------------- 12 + src/basic/path-lookup.c | 17 ++--------------- 14 13 src/core/systemd.pc.in | 5 +++-- 15 - 2 files changed, 8 insertions(+), 17 deletions(-) 14 + 2 files changed, 5 insertions(+), 17 deletions(-) 16 15 17 16 diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c 18 - index 96b82170d0..b9fbed5c61 100644 17 + index 96b82170d0..bf66bd6b77 100644 19 18 --- a/src/basic/path-lookup.c 20 19 +++ b/src/basic/path-lookup.c 21 - @@ -94,17 +94,14 @@ int xdg_user_data_dir(char **ret, const char *suffix) { 20 + @@ -94,11 +94,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) { 22 21 } 23 22 24 23 static const char* const user_data_unit_paths[] = { ··· 30 29 NULL 31 30 }; 32 31 33 - static const char* const user_config_unit_paths[] = { 34 - USER_CONFIG_UNIT_DIR, 35 - "/etc/systemd/user", 36 - + "/etc/systemd-mutable/user", 37 - NULL 38 - }; 39 - 40 - @@ -616,15 +613,14 @@ int lookup_paths_init( 32 + @@ -616,15 +612,13 @@ int lookup_paths_init( 41 33 persistent_config, 42 34 SYSTEM_CONFIG_UNIT_DIR, 43 35 "/etc/systemd/system", 44 - + "/etc/systemd-mutable/system", 45 36 + "/nix/var/nix/profiles/default/lib/systemd/system", 46 37 STRV_IFNOTNULL(persistent_attached), 47 38 runtime_config, ··· 55 46 STRV_IFNOTNULL(generator_late)); 56 47 break; 57 48 58 - @@ -640,14 +636,12 @@ int lookup_paths_init( 49 + @@ -640,14 +634,11 @@ int lookup_paths_init( 59 50 persistent_config, 60 51 USER_CONFIG_UNIT_DIR, 61 52 "/etc/systemd/user", 62 - + "/etc/systemd-mutable/user", 63 53 + "/nix/var/nix/profiles/default/lib/systemd/user", 64 54 runtime_config, 65 55 "/run/systemd/user", ··· 72 62 STRV_IFNOTNULL(generator_late)); 73 63 break; 74 64 75 - @@ -797,7 +791,6 @@ char **generator_binary_paths(UnitFileScope scope) { 65 + @@ -797,7 +788,6 @@ char **generator_binary_paths(UnitFileScope scope) { 76 66 case UNIT_FILE_SYSTEM: 77 67 add = strv_new("/run/systemd/system-generators", 78 68 "/etc/systemd/system-generators", ··· 80 70 SYSTEM_GENERATOR_DIR); 81 71 break; 82 72 83 - @@ -805,7 +798,6 @@ char **generator_binary_paths(UnitFileScope scope) { 73 + @@ -805,7 +795,6 @@ char **generator_binary_paths(UnitFileScope scope) { 84 74 case UNIT_FILE_USER: 85 75 add = strv_new("/run/systemd/user-generators", 86 76 "/etc/systemd/user-generators", ··· 88 78 USER_GENERATOR_DIR); 89 79 break; 90 80 91 - @@ -844,12 +836,10 @@ char **env_generator_binary_paths(bool is_system) { 81 + @@ -844,12 +833,10 @@ char **env_generator_binary_paths(bool is_system) { 92 82 if (is_system) 93 83 add = strv_new("/run/systemd/system-environment-generators", 94 84 "/etc/systemd/system-environment-generators", ··· 102 92 103 93 if (!add) 104 94 diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in 105 - index f2c045511d..ccb382e421 100644 95 + index f2c045511d..d38a3a0302 100644 106 96 --- a/src/core/systemd.pc.in 107 97 +++ b/src/core/systemd.pc.in 108 98 @@ -38,10 +38,11 @@ systemdsystemconfdir=${systemd_system_conf_dir} ··· 110 100 systemduserconfdir=${systemd_user_conf_dir} 111 101 112 102 -systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemd_system_unit_dir}:/usr/lib/systemd/system:/lib/systemd/system 113 - +systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/etc/systemd-mutable/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir} 103 + +systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir} 114 104 systemdsystemunitpath=${systemd_system_unit_path} 115 105 116 106 -systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemd_user_unit_dir}:/usr/lib/systemd/user:/usr/share/systemd/user 117 - +systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/etc/systemd-mutable/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir} 107 + +systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir} 118 108 + 119 109 systemduserunitpath=${systemd_user_unit_path} 120 110