about summary refs log tree commit diff
path: root/nixos/modules/services/x11/redshift.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/x11/redshift.nix')
-rw-r--r--nixos/modules/services/x11/redshift.nix9
1 files changed, 2 insertions, 7 deletions
diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix
index eb5dfdf95849..992709ed0000 100644
--- a/nixos/modules/services/x11/redshift.nix
+++ b/nixos/modules/services/x11/redshift.nix
@@ -95,7 +95,8 @@ in {
   config = mkIf cfg.enable {
     systemd.user.services.redshift = {
       description = "Redshift colour temperature adjuster";
-      wantedBy = [ "default.target" ];
+      wantedBy = [ "graphical-session.target" ];
+      partOf = [ "graphical-session.target" ];
       serviceConfig = {
         ExecStart = ''
           ${cfg.package}/bin/redshift \
@@ -107,12 +108,6 @@ in {
         RestartSec = 3;
         Restart = "always";
       };
-      environment = {
-        DISPLAY = ":${toString (
-          let display = config.services.xserver.display;
-          in if display != null then display else 0
-        )}";
-      };
     };
   };