diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix index 63ffa29c199..78a97df9877 100644 --- a/nixos/modules/services/x11/redshift.nix +++ b/nixos/modules/services/x11/redshift.nix @@ -108,7 +108,12 @@ in { RestartSec = 3; Restart = "always"; }; - environment = { DISPLAY = ":${toString config.services.xserver.display}"; }; + environment = { + DISPLAY = ":${toString ( + let display = config.services.xserver.display; + in if display != null then display else 0 + )}"; + }; }; };