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