-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
273 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ Original-Author: Eelco Dolstra <[email protected]> | |
2 files changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c | ||
index eac5bb8d3b..d8187bfa99 100644 | ||
index d6a256c4a7..f74d5198f1 100644 | ||
--- a/src/shared/fstab-util.c | ||
+++ b/src/shared/fstab-util.c | ||
@@ -66,6 +66,8 @@ bool fstab_is_extrinsic(const char *mount, const char *opts) { | ||
|
@@ -27,7 +27,7 @@ index eac5bb8d3b..d8187bfa99 100644 | |
"/etc")) | ||
return true; | ||
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c | ||
index ca6d36e054..0a9227c9a8 100644 | ||
index 4bc01c75e0..ede9ac7b87 100644 | ||
--- a/src/shutdown/umount.c | ||
+++ b/src/shutdown/umount.c | ||
@@ -170,8 +170,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,105 +11,24 @@ Also, remove /usr and /lib as these don't exist on NixOS. | |
|
||
Original-Author: Eelco Dolstra <[email protected]> | ||
--- | ||
src/basic/path-lookup.c | 18 ++---------------- | ||
src/core/systemd.pc.in | 8 ++++---- | ||
2 files changed, 6 insertions(+), 20 deletions(-) | ||
src/core/systemd.pc.in | 8 ++++---- | ||
src/libsystemd/sd-path/path-lookup.c | 20 +++----------------- | ||
2 files changed, 7 insertions(+), 21 deletions(-) | ||
|
||
diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c | ||
index 540256b73b..a115ec09a3 100644 | ||
--- a/src/basic/path-lookup.c | ||
+++ b/src/basic/path-lookup.c | ||
@@ -123,11 +123,7 @@ int runtime_directory(char **ret, RuntimeScope scope, const char *suffix) { | ||
} | ||
|
||
static const char* const user_data_unit_paths[] = { | ||
- "/usr/local/lib/systemd/user", | ||
- "/usr/local/share/systemd/user", | ||
USER_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/user", | ||
- "/usr/share/systemd/user", | ||
NULL | ||
}; | ||
|
||
@@ -634,16 +630,13 @@ int lookup_paths_init( | ||
persistent_config, | ||
SYSTEM_CONFIG_UNIT_DIR, | ||
"/etc/systemd/system", | ||
+ "/nix/var/nix/profiles/default/lib/systemd/system", | ||
STRV_IFNOTNULL(persistent_attached), | ||
runtime_config, | ||
"/run/systemd/system", | ||
STRV_IFNOTNULL(runtime_attached), | ||
STRV_IFNOTNULL(generator), | ||
- "/usr/local/lib/systemd/system", | ||
SYSTEM_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/system", | ||
- /* To be used ONLY for images which might be legacy split-usr */ | ||
- STRV_IFNOTNULL(flags & LOOKUP_PATHS_SPLIT_USR ? "/lib/systemd/system" : NULL), | ||
STRV_IFNOTNULL(generator_late)); | ||
break; | ||
|
||
@@ -659,14 +652,11 @@ int lookup_paths_init( | ||
persistent_config, | ||
USER_CONFIG_UNIT_DIR, | ||
"/etc/systemd/user", | ||
+ "/nix/var/nix/profiles/default/lib/systemd/user", | ||
runtime_config, | ||
"/run/systemd/user", | ||
STRV_IFNOTNULL(generator), | ||
- "/usr/local/share/systemd/user", | ||
- "/usr/share/systemd/user", | ||
- "/usr/local/lib/systemd/user", | ||
USER_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/user", | ||
STRV_IFNOTNULL(generator_late)); | ||
break; | ||
|
||
@@ -825,7 +815,6 @@ char **generator_binary_paths(RuntimeScope scope) { | ||
case RUNTIME_SCOPE_SYSTEM: | ||
add = strv_new("/run/systemd/system-generators", | ||
"/etc/systemd/system-generators", | ||
- "/usr/local/lib/systemd/system-generators", | ||
SYSTEM_GENERATOR_DIR); | ||
break; | ||
|
||
@@ -833,7 +822,6 @@ char **generator_binary_paths(RuntimeScope scope) { | ||
case RUNTIME_SCOPE_USER: | ||
add = strv_new("/run/systemd/user-generators", | ||
"/etc/systemd/user-generators", | ||
- "/usr/local/lib/systemd/user-generators", | ||
USER_GENERATOR_DIR); | ||
break; | ||
|
||
@@ -872,14 +860,12 @@ char **env_generator_binary_paths(RuntimeScope runtime_scope) { | ||
case RUNTIME_SCOPE_SYSTEM: | ||
add = strv_new("/run/systemd/system-environment-generators", | ||
"/etc/systemd/system-environment-generators", | ||
- "/usr/local/lib/systemd/system-environment-generators", | ||
SYSTEM_ENV_GENERATOR_DIR); | ||
break; | ||
|
||
case RUNTIME_SCOPE_USER: | ||
add = strv_new("/run/systemd/user-environment-generators", | ||
"/etc/systemd/user-environment-generators", | ||
- "/usr/local/lib/systemd/user-environment-generators", | ||
USER_ENV_GENERATOR_DIR); | ||
break; | ||
|
||
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in | ||
index f3b85b0190..8ae544b495 100644 | ||
index f3b85b0190..f7aa5fca50 100644 | ||
--- a/src/core/systemd.pc.in | ||
+++ b/src/core/systemd.pc.in | ||
@@ -43,10 +43,10 @@ systemdsystemconfdir=${systemd_system_conf_dir} | ||
systemd_user_conf_dir=${sysconfdir}/systemd/user | ||
systemduserconfdir=${systemd_user_conf_dir} | ||
|
||
-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 | ||
+systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir} | ||
+systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemd_system_unit_dir} | ||
systemdsystemunitpath=${systemd_system_unit_path} | ||
|
||
-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 | ||
+systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir} | ||
+systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemd_user_unit_dir} | ||
systemduserunitpath=${systemd_user_unit_path} | ||
|
||
systemd_system_generator_dir=${prefix}/lib/systemd/system-generators | ||
|
@@ -126,3 +45,85 @@ index f3b85b0190..8ae544b495 100644 | |
systemdusergeneratorpath=${systemd_user_generator_path} | ||
|
||
systemd_sleep_dir=${prefix}/lib/systemd/system-sleep | ||
diff --git a/src/libsystemd/sd-path/path-lookup.c b/src/libsystemd/sd-path/path-lookup.c | ||
index a3b09208cb..91a085c6bc 100644 | ||
--- a/src/libsystemd/sd-path/path-lookup.c | ||
+++ b/src/libsystemd/sd-path/path-lookup.c | ||
@@ -69,11 +69,7 @@ int runtime_directory(RuntimeScope scope, const char *suffix, char **ret) { | ||
} | ||
|
||
static const char* const user_data_unit_paths[] = { | ||
- "/usr/local/lib/systemd/user", | ||
- "/usr/local/share/systemd/user", | ||
USER_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/user", | ||
- "/usr/share/systemd/user", | ||
NULL | ||
}; | ||
|
||
@@ -481,16 +477,13 @@ int lookup_paths_init( | ||
persistent_config, | ||
SYSTEM_CONFIG_UNIT_DIR, | ||
"/etc/systemd/system", | ||
+ "/nix/var/nix/profiles/default/lib/systemd/system", | ||
ASSERT_PTR(persistent_attached), | ||
ASSERT_PTR(runtime_config), | ||
"/run/systemd/system", | ||
ASSERT_PTR(runtime_attached), | ||
STRV_IFNOTNULL(generator), | ||
- "/usr/local/lib/systemd/system", | ||
SYSTEM_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/system", | ||
- /* To be used ONLY for images which might be legacy split-usr */ | ||
- FLAGS_SET(flags, LOOKUP_PATHS_SPLIT_USR) ? "/lib/systemd/system" : STRV_IGNORE, | ||
STRV_IFNOTNULL(generator_late)); | ||
break; | ||
|
||
@@ -508,13 +501,10 @@ int lookup_paths_init( | ||
add = strv_new(persistent_config, | ||
USER_CONFIG_UNIT_DIR, | ||
"/etc/systemd/user", | ||
+ "/nix/var/nix/profiles/default/lib/systemd/user", | ||
ASSERT_PTR(runtime_config), | ||
"/run/systemd/user", | ||
- "/usr/local/share/systemd/user", | ||
- "/usr/share/systemd/user", | ||
- "/usr/local/lib/systemd/user", | ||
- USER_DATA_UNIT_DIR, | ||
- "/usr/lib/systemd/user"); | ||
+ USER_DATA_UNIT_DIR); | ||
break; | ||
|
||
case RUNTIME_SCOPE_USER: | ||
@@ -653,7 +643,6 @@ void lookup_paths_log(LookupPaths *lp) { | ||
static const char* const system_generator_paths[] = { | ||
"/run/systemd/system-generators", | ||
"/etc/systemd/system-generators", | ||
- "/usr/local/lib/systemd/system-generators", | ||
SYSTEM_GENERATOR_DIR, | ||
NULL, | ||
}; | ||
@@ -661,7 +650,6 @@ static const char* const system_generator_paths[] = { | ||
static const char* const user_generator_paths[] = { | ||
"/run/systemd/user-generators", | ||
"/etc/systemd/user-generators", | ||
- "/usr/local/lib/systemd/user-generators", | ||
USER_GENERATOR_DIR, | ||
NULL, | ||
}; | ||
@@ -669,7 +657,6 @@ static const char* const user_generator_paths[] = { | ||
static const char* const system_env_generator_paths[] = { | ||
"/run/systemd/system-environment-generators", | ||
"/etc/systemd/system-environment-generators", | ||
- "/usr/local/lib/systemd/system-environment-generators", | ||
SYSTEM_ENV_GENERATOR_DIR, | ||
NULL, | ||
}; | ||
@@ -677,7 +664,6 @@ static const char* const system_env_generator_paths[] = { | ||
static const char* const user_env_generator_paths[] = { | ||
"/run/systemd/user-environment-generators", | ||
"/etc/systemd/user-environment-generators", | ||
- "/usr/local/lib/systemd/user-environment-generators", | ||
USER_ENV_GENERATOR_DIR, | ||
NULL, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.