summary refs log tree commit diff
path: root/nixos/modules/config/console.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-12-12 21:19:24 +0100
committerFlorian Klink <flokli@flokli.de>2020-12-12 21:21:51 +0100
commit536988b35efbff449d0398319e13da09af8d0d5e (patch)
tree73a03c4f25b5654c21c1f6e63db5ac64652b7abf /nixos/modules/config/console.nix
parent3043fe5b849c48cf242ec59d1ee1cf0778a107e8 (diff)
downloadnixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar.gz
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar.bz2
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar.lz
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar.xz
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.tar.zst
nixpkgs-536988b35efbff449d0398319e13da09af8d0d5e.zip
nixos/console: fix Before= on the systemd-vconsole-setup unit
Only set Before=display-manager.service if it is actually present.

On headless systems, `systemctl list-units --state not-found` will
otherwise show display-manager.service.

Reported-In: https://github.com/NixOS/nixpkgs/issues/88597
Diffstat (limited to 'nixos/modules/config/console.nix')
-rw-r--r--nixos/modules/config/console.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix
index f662ed62d31..374c23f13ef 100644
--- a/nixos/modules/config/console.nix
+++ b/nixos/modules/config/console.nix
@@ -159,7 +159,8 @@ in
         '';
 
         systemd.services.systemd-vconsole-setup =
-          { before = [ "display-manager.service" ];
+          {
+            before = optional config.services.xserver.enable "display-manager.service";
             after = [ "systemd-udev-settle.service" ];
             restartTriggers = [ vconsoleConf consoleEnv ];
           };