2020-04-30 01:08:05 +02:00
|
|
|
From 45f80155b7c2edb1e73c233283f1ab1582e1cfbe Mon Sep 17 00:00:00 2001
|
2020-01-26 14:56:41 +01:00
|
|
|
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
|
|
|
|
Date: Fri, 19 Dec 2014 14:46:17 +0100
|
2020-04-30 01:03:18 +02:00
|
|
|
Subject: [PATCH 05/18] Add some NixOS-specific unit directories
|
2020-01-26 14:56:41 +01:00
|
|
|
|
2020-04-30 01:08:05 +02:00
|
|
|
Look in `/nix/var/nix/profiles/default/lib/systemd` for units provided
|
|
|
|
by packages installed into the default profile via
|
|
|
|
`nix-env -iA nixos.$package`, and into `/etc/systemd-mutable/system` for
|
|
|
|
persistent, mutable units (used for Dysnomia).
|
2020-01-26 14:56:41 +01:00
|
|
|
|
|
|
|
Also, remove /usr and /lib as these don't exist on NixOS.
|
|
|
|
---
|
|
|
|
src/core/systemd.pc.in | 4 ++--
|
|
|
|
src/shared/path-lookup.c | 18 +++++-------------
|
|
|
|
2 files changed, 7 insertions(+), 15 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
|
2020-04-30 01:03:18 +02:00
|
|
|
index 8331832c7a..bedb97115d 100644
|
2020-01-26 14:56:41 +01:00
|
|
|
--- a/src/core/systemd.pc.in
|
|
|
|
+++ b/src/core/systemd.pc.in
|
|
|
|
@@ -17,8 +17,8 @@ systemduserunitdir=${prefix}/lib/systemd/user
|
|
|
|
systemduserpresetdir=${prefix}/lib/systemd/user-preset
|
|
|
|
systemdsystemconfdir=${sysconfdir}/systemd/system
|
|
|
|
systemduserconfdir=${sysconfdir}/systemd/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:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/system:${systemdsystemunitdir}
|
|
|
|
+systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/etc/systemd-mutable/user:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/user:${systemduserunitdir}
|
|
|
|
systemdsystemgeneratordir=${rootprefix}/lib/systemd/system-generators
|
|
|
|
systemdusergeneratordir=${prefix}/lib/systemd/user-generators
|
2020-04-30 01:03:18 +02:00
|
|
|
systemdsystemgeneratorpath=/run/systemd/system-generators:/etc/systemd/system-generators:/usr/local/lib/systemd/system-generators:${systemdsystemgeneratordir}
|
2020-01-26 14:56:41 +01:00
|
|
|
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
|
2020-04-30 01:08:05 +02:00
|
|
|
index 48e0eec09a..a9d38f16d0 100644
|
2020-01-26 14:56:41 +01:00
|
|
|
--- a/src/shared/path-lookup.c
|
|
|
|
+++ b/src/shared/path-lookup.c
|
2020-04-30 01:03:18 +02:00
|
|
|
@@ -98,17 +98,14 @@ int xdg_user_data_dir(char **ret, const char *suffix) {
|
2020-01-26 14:56:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char* const user_data_unit_paths[] = {
|
|
|
|
- "/usr/local/lib/systemd/user",
|
|
|
|
- "/usr/local/share/systemd/user",
|
|
|
|
USER_DATA_UNIT_PATH,
|
|
|
|
- "/usr/lib/systemd/user",
|
|
|
|
- "/usr/share/systemd/user",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char* const user_config_unit_paths[] = {
|
|
|
|
USER_CONFIG_UNIT_PATH,
|
|
|
|
"/etc/systemd/user",
|
|
|
|
+ "/etc/systemd-mutable/user",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2020-04-30 01:08:05 +02:00
|
|
|
@@ -604,15 +601,14 @@ int lookup_paths_init(
|
2020-01-26 14:56:41 +01:00
|
|
|
persistent_config,
|
|
|
|
SYSTEM_CONFIG_UNIT_PATH,
|
|
|
|
"/etc/systemd/system",
|
|
|
|
+ "/etc/systemd-mutable/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;
|
|
|
|
|
2020-04-30 01:08:05 +02:00
|
|
|
@@ -628,14 +624,12 @@ int lookup_paths_init(
|
2020-01-26 14:56:41 +01:00
|
|
|
persistent_config,
|
|
|
|
USER_CONFIG_UNIT_PATH,
|
|
|
|
"/etc/systemd/user",
|
|
|
|
+ "/etc/systemd-mutable/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_PATH,
|
|
|
|
- "/usr/lib/systemd/user",
|
|
|
|
STRV_IFNOTNULL(generator_late));
|
|
|
|
break;
|
|
|
|
|
2020-04-30 01:08:05 +02:00
|
|
|
@@ -824,14 +818,12 @@ char **generator_binary_paths(UnitFileScope scope) {
|
2020-01-26 14:56:41 +01:00
|
|
|
case UNIT_FILE_SYSTEM:
|
|
|
|
return strv_new("/run/systemd/system-generators",
|
|
|
|
"/etc/systemd/system-generators",
|
|
|
|
- "/usr/local/lib/systemd/system-generators",
|
|
|
|
SYSTEM_GENERATOR_PATH);
|
|
|
|
|
|
|
|
case UNIT_FILE_GLOBAL:
|
|
|
|
case UNIT_FILE_USER:
|
|
|
|
return strv_new("/run/systemd/user-generators",
|
|
|
|
"/etc/systemd/user-generators",
|
|
|
|
- "/usr/local/lib/systemd/user-generators",
|
|
|
|
USER_GENERATOR_PATH);
|
|
|
|
|
|
|
|
default:
|
|
|
|
--
|
2020-04-30 01:03:18 +02:00
|
|
|
2.26.2
|
2020-01-26 14:56:41 +01:00
|
|
|
|