From 913747b843a499ccabf467dce268cb118419cbdb Mon Sep 17 00:00:00 2001 From: Sam Pointon Date: Sat, 11 Apr 2026 13:39:13 +0100 Subject: [PATCH] nixos/logind: only enable if systemd-logind was built --- nixos/modules/system/boot/systemd/logind.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/systemd/logind.nix b/nixos/modules/system/boot/systemd/logind.nix index 22d9195536b3..ffafcd7ae1fd 100644 --- a/nixos/modules/system/boot/systemd/logind.nix +++ b/nixos/modules/system/boot/systemd/logind.nix @@ -6,6 +6,10 @@ }: { options.services.logind = { + enable = lib.mkEnableOption "the `systemd-logind` login service" // { + default = config.systemd.package.withLogind; + defaultText = lib.literalExpression "config.systemd.package.withLogind"; + }; settings.Login = lib.mkOption { description = '' Settings option for systemd-logind. @@ -40,7 +44,7 @@ }; }; - config = { + config = lib.mkIf config.services.logind.enable { systemd.additionalUpstreamSystemUnits = [ "systemd-logind.service" "autovt@.service"