summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-05-23 11:35:01 +0200
committerGitHub <noreply@github.com>2022-05-23 11:35:01 +0200
commit240372310855f63545c486c722e5e87526c50665 (patch)
tree03c91514ad55b8d4d861b4b02b61abcd3cf7a74f /nixos
parentad532c1d80c5a78804894a5db3fcca5dfd1d5851 (diff)
parentcbcc746f8f521849687d225c4a3f85b2beb24168 (diff)
Merge pull request #172652 from klemensn/systemd-optional-system-units
nixos/systemd: Package only built component units
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd.nix17
-rw-r--r--nixos/modules/system/boot/systemd/logind.nix3
2 files changed, 15 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 2c9ee9fc319f..679c5210a6b3 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -35,11 +35,11 @@ let
"nss-lookup.target"
"nss-user-lookup.target"
"time-sync.target"
- ] ++ (optionals cfg.package.withCryptsetup [
+ ] ++ optionals cfg.package.withCryptsetup [
"cryptsetup.target"
"cryptsetup-pre.target"
"remote-cryptsetup.target"
- ]) ++ [
+ ] ++ [
"sigpwr.target"
"timers.target"
"paths.target"
@@ -133,20 +133,27 @@ let
# Slices / containers.
"slices.target"
+ ] ++ optionals cfg.package.withImportd [
+ "systemd-importd.service"
+ ] ++ optionals cfg.package.withMachined [
"machine.slice"
"machines.target"
- "systemd-importd.service"
"systemd-machined.service"
+ ] ++ [
"systemd-nspawn@.service"
# Misc.
"systemd-sysctl.service"
+ ] ++ optionals cfg.package.withTimedated [
"dbus-org.freedesktop.timedate1.service"
- "dbus-org.freedesktop.locale1.service"
- "dbus-org.freedesktop.hostname1.service"
"systemd-timedated.service"
+ ] ++ optionals cfg.package.withLocaled [
+ "dbus-org.freedesktop.locale1.service"
"systemd-localed.service"
+ ] ++ optionals cfg.package.withHostnamed [
+ "dbus-org.freedesktop.hostname1.service"
"systemd-hostnamed.service"
+ ] ++ [
"systemd-exit.service"
"systemd-update-done.service"
] ++ cfg.additionalUpstreamSystemUnits;
diff --git a/nixos/modules/system/boot/systemd/logind.nix b/nixos/modules/system/boot/systemd/logind.nix
index c1e6cfe61d04..97ac588bce17 100644
--- a/nixos/modules/system/boot/systemd/logind.nix
+++ b/nixos/modules/system/boot/systemd/logind.nix
@@ -81,8 +81,11 @@ in
"systemd-logind.service"
"autovt@.service"
"systemd-user-sessions.service"
+ ] ++ optionals config.systemd.package.withImportd [
"dbus-org.freedesktop.import1.service"
+ ] ++ optionals config.systemd.package.withMachined [
"dbus-org.freedesktop.machine1.service"
+ ] ++ [
"dbus-org.freedesktop.login1.service"
"user@.service"
"user-runtime-dir@.service"