nixos/systemd: Package only built component units
Account for all `with*` options causing their respective unit files to not be built, just like the current code `withCryptsetup` already does. This fixes build errors like the following: ``` missing /nix/store/5fafsfms64fn3ywv274ky7arhm9yq2if-systemd-250.4/example/systemd/system/systemd-importd.service error: builder for '/nix/store/67rdli5q5akzwmqgf8q0a1yp76jgr0px-system-units.drv' failed with exit code 1 ``` Found by using a customised systemd package as follows: ``` systemd.package = pkgs.systemd-small; nixpkgs.config.packageOverrides = pkgs: { "systemd-small" = pkgs.systemd.override { withImportd = false; withMachined = false; ... }; }; ```
This commit is contained in:
parent
3e789af26c
commit
cbcc746f8f
@ -35,11 +35,11 @@ let
|
|||||||
"nss-lookup.target"
|
"nss-lookup.target"
|
||||||
"nss-user-lookup.target"
|
"nss-user-lookup.target"
|
||||||
"time-sync.target"
|
"time-sync.target"
|
||||||
] ++ (optionals cfg.package.withCryptsetup [
|
] ++ optionals cfg.package.withCryptsetup [
|
||||||
"cryptsetup.target"
|
"cryptsetup.target"
|
||||||
"cryptsetup-pre.target"
|
"cryptsetup-pre.target"
|
||||||
"remote-cryptsetup.target"
|
"remote-cryptsetup.target"
|
||||||
]) ++ [
|
] ++ [
|
||||||
"sigpwr.target"
|
"sigpwr.target"
|
||||||
"timers.target"
|
"timers.target"
|
||||||
"paths.target"
|
"paths.target"
|
||||||
@ -133,20 +133,27 @@ let
|
|||||||
|
|
||||||
# Slices / containers.
|
# Slices / containers.
|
||||||
"slices.target"
|
"slices.target"
|
||||||
|
] ++ optionals cfg.package.withImportd [
|
||||||
|
"systemd-importd.service"
|
||||||
|
] ++ optionals cfg.package.withMachined [
|
||||||
"machine.slice"
|
"machine.slice"
|
||||||
"machines.target"
|
"machines.target"
|
||||||
"systemd-importd.service"
|
|
||||||
"systemd-machined.service"
|
"systemd-machined.service"
|
||||||
|
] ++ [
|
||||||
"systemd-nspawn@.service"
|
"systemd-nspawn@.service"
|
||||||
|
|
||||||
# Misc.
|
# Misc.
|
||||||
"systemd-sysctl.service"
|
"systemd-sysctl.service"
|
||||||
|
] ++ optionals cfg.package.withTimedated [
|
||||||
"dbus-org.freedesktop.timedate1.service"
|
"dbus-org.freedesktop.timedate1.service"
|
||||||
"dbus-org.freedesktop.locale1.service"
|
|
||||||
"dbus-org.freedesktop.hostname1.service"
|
|
||||||
"systemd-timedated.service"
|
"systemd-timedated.service"
|
||||||
|
] ++ optionals cfg.package.withLocaled [
|
||||||
|
"dbus-org.freedesktop.locale1.service"
|
||||||
"systemd-localed.service"
|
"systemd-localed.service"
|
||||||
|
] ++ optionals cfg.package.withHostnamed [
|
||||||
|
"dbus-org.freedesktop.hostname1.service"
|
||||||
"systemd-hostnamed.service"
|
"systemd-hostnamed.service"
|
||||||
|
] ++ [
|
||||||
"systemd-exit.service"
|
"systemd-exit.service"
|
||||||
"systemd-update-done.service"
|
"systemd-update-done.service"
|
||||||
] ++ cfg.additionalUpstreamSystemUnits;
|
] ++ cfg.additionalUpstreamSystemUnits;
|
||||||
|
@ -81,8 +81,11 @@ in
|
|||||||
"systemd-logind.service"
|
"systemd-logind.service"
|
||||||
"autovt@.service"
|
"autovt@.service"
|
||||||
"systemd-user-sessions.service"
|
"systemd-user-sessions.service"
|
||||||
|
] ++ optionals config.systemd.package.withImportd [
|
||||||
"dbus-org.freedesktop.import1.service"
|
"dbus-org.freedesktop.import1.service"
|
||||||
|
] ++ optionals config.systemd.package.withMachined [
|
||||||
"dbus-org.freedesktop.machine1.service"
|
"dbus-org.freedesktop.machine1.service"
|
||||||
|
] ++ [
|
||||||
"dbus-org.freedesktop.login1.service"
|
"dbus-org.freedesktop.login1.service"
|
||||||
"user@.service"
|
"user@.service"
|
||||||
"user-runtime-dir@.service"
|
"user-runtime-dir@.service"
|
||||||
|
@ -687,7 +687,7 @@ stdenv.mkDerivation {
|
|||||||
# runtime; otherwise we can't and we need to reboot.
|
# runtime; otherwise we can't and we need to reboot.
|
||||||
interfaceVersion = 2;
|
interfaceVersion = 2;
|
||||||
|
|
||||||
inherit withCryptsetup util-linux kmod kbd;
|
inherit withCryptsetup withHostnamed withImportd withLocaled withMachined withTimedated util-linux kmod kbd;
|
||||||
|
|
||||||
tests = {
|
tests = {
|
||||||
inherit (nixosTests) switchTest;
|
inherit (nixosTests) switchTest;
|
||||||
|
Loading…
Reference in New Issue
Block a user