2021-04-12 18:23:04 +00:00
|
|
|
From 8b7f881cf22e98e907506f4c403b9e304e332bf9 Mon Sep 17 00:00:00 2001
|
2020-04-24 23:36:52 +00:00
|
|
|
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
|
|
|
|
Date: Fri, 19 Dec 2014 14:46:17 +0100
|
2021-04-12 18:23:04 +00:00
|
|
|
Subject: [PATCH 05/19] Add some NixOS-specific unit directories
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
Look in `/nix/var/nix/profiles/default/lib/systemd/{system,user}` for
|
|
|
|
units provided by packages installed into the default profile via
|
|
|
|
`nix-env -iA nixos.$package`.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
Also, remove /usr and /lib as these don't exist on NixOS.
|
|
|
|
---
|
2021-03-09 03:18:52 +00:00
|
|
|
src/basic/path-lookup.c | 17 ++---------------
|
2020-09-25 04:45:31 +00:00
|
|
|
src/core/systemd.pc.in | 5 +++--
|
2021-03-09 03:18:52 +00:00
|
|
|
2 files changed, 5 insertions(+), 17 deletions(-)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c
|
2021-03-09 03:18:52 +00:00
|
|
|
index 96b82170d0..bf66bd6b77 100644
|
2020-09-25 04:45:31 +00:00
|
|
|
--- a/src/basic/path-lookup.c
|
|
|
|
+++ b/src/basic/path-lookup.c
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -94,11 +94,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) {
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char* const user_data_unit_paths[] = {
|
|
|
|
- "/usr/local/lib/systemd/user",
|
|
|
|
- "/usr/local/share/systemd/user",
|
2020-09-25 04:45:31 +00:00
|
|
|
USER_DATA_UNIT_DIR,
|
2020-04-24 23:36:52 +00:00
|
|
|
- "/usr/lib/systemd/user",
|
|
|
|
- "/usr/share/systemd/user",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -616,15 +612,13 @@ int lookup_paths_init(
|
2020-04-24 23:36:52 +00:00
|
|
|
persistent_config,
|
2020-09-25 04:45:31 +00:00
|
|
|
SYSTEM_CONFIG_UNIT_DIR,
|
2020-04-24 23:36:52 +00:00
|
|
|
"/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_PATH,
|
|
|
|
- "/usr/lib/systemd/system",
|
|
|
|
- STRV_IFNOTNULL(flags & LOOKUP_PATHS_SPLIT_USR ? "/lib/systemd/system" : NULL),
|
|
|
|
STRV_IFNOTNULL(generator_late));
|
|
|
|
break;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -640,14 +634,11 @@ int lookup_paths_init(
|
2020-04-24 23:36:52 +00:00
|
|
|
persistent_config,
|
2020-09-25 04:45:31 +00:00
|
|
|
USER_CONFIG_UNIT_DIR,
|
2020-04-24 23:36:52 +00:00
|
|
|
"/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",
|
2020-09-25 04:45:31 +00:00
|
|
|
USER_DATA_UNIT_DIR,
|
2020-04-24 23:36:52 +00:00
|
|
|
- "/usr/lib/systemd/user",
|
|
|
|
STRV_IFNOTNULL(generator_late));
|
|
|
|
break;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -797,7 +788,6 @@ char **generator_binary_paths(UnitFileScope scope) {
|
2020-09-25 04:45:31 +00:00
|
|
|
case UNIT_FILE_SYSTEM:
|
|
|
|
add = strv_new("/run/systemd/system-generators",
|
|
|
|
"/etc/systemd/system-generators",
|
|
|
|
- "/usr/local/lib/systemd/system-generators",
|
|
|
|
SYSTEM_GENERATOR_DIR);
|
|
|
|
break;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -805,7 +795,6 @@ char **generator_binary_paths(UnitFileScope scope) {
|
2020-09-25 04:45:31 +00:00
|
|
|
case UNIT_FILE_USER:
|
|
|
|
add = strv_new("/run/systemd/user-generators",
|
|
|
|
"/etc/systemd/user-generators",
|
|
|
|
- "/usr/local/lib/systemd/user-generators",
|
|
|
|
USER_GENERATOR_DIR);
|
|
|
|
break;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
@@ -844,12 +833,10 @@ char **env_generator_binary_paths(bool is_system) {
|
2020-09-25 04:45:31 +00:00
|
|
|
if (is_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);
|
|
|
|
else
|
|
|
|
add = strv_new("/run/systemd/user-environment-generators",
|
|
|
|
"/etc/systemd/user-environment-generators",
|
|
|
|
- "/usr/local/lib/systemd/user-environment-generators",
|
|
|
|
USER_ENV_GENERATOR_DIR);
|
|
|
|
|
|
|
|
if (!add)
|
|
|
|
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
|
2021-04-12 18:23:04 +00:00
|
|
|
index b5cc8f94a5..a701cd05f8 100644
|
2020-09-25 04:45:31 +00:00
|
|
|
--- a/src/core/systemd.pc.in
|
|
|
|
+++ b/src/core/systemd.pc.in
|
|
|
|
@@ -38,10 +38,11 @@ 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
|
2021-03-09 03:18:52 +00:00
|
|
|
+systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/system:${systemdsystemunitdir}
|
2020-09-25 04:45:31 +00:00
|
|
|
systemdsystemunitpath=${systemd_system_unit_path}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
-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
|
2021-03-09 03:18:52 +00:00
|
|
|
+systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/user:${systemduserunitdir}
|
2020-09-25 04:45:31 +00:00
|
|
|
+
|
|
|
|
systemduserunitpath=${systemd_user_unit_path}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
systemd_system_generator_dir=${root_prefix}/lib/systemd/system-generators
|
2020-04-24 23:36:52 +00:00
|
|
|
--
|
2021-04-12 18:23:04 +00:00
|
|
|
2.30.1
|
2020-04-24 23:36:52 +00:00
|
|
|
|