From 9c17c5ccbbf5626f684eecc2ce660086ac8e249c Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 26 Jun 2017 18:34:09 +0200 Subject: [PATCH] Clean up systemd units for all graphical services --- modules/services/dunst.nix | 4 ++-- modules/services/gnome-keyring.nix | 3 ++- modules/services/keepassx.nix | 2 ++ modules/services/network-manager-applet.nix | 2 ++ modules/services/random-background.nix | 2 ++ modules/services/redshift.nix | 2 ++ modules/services/taffybar.nix | 2 ++ modules/services/udiskie.nix | 2 ++ modules/services/xscreensaver.nix | 2 ++ modules/xsession.nix | 2 ++ 10 files changed, 20 insertions(+), 3 deletions(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index a70e8d311..c1f29d942 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -22,8 +22,8 @@ with lib; systemd.user.services.dunst = { Unit = { Description = "Dunst notification daemon"; - Requires = "graphical-session.target"; - After = "graphical-session.target"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { diff --git a/modules/services/gnome-keyring.nix b/modules/services/gnome-keyring.nix index b0edeaed4..b7097d7cd 100644 --- a/modules/services/gnome-keyring.nix +++ b/modules/services/gnome-keyring.nix @@ -28,6 +28,7 @@ in systemd.user.services.gnome-keyring = { Unit = { Description = "GNOME Keyring"; + PartOf = [ "graphical-session-pre.target" ]; }; Service = { @@ -45,7 +46,7 @@ in }; Install = { - WantedBy = [ "graphical-session.target" ]; + WantedBy = [ "graphical-session-pre.target" ]; }; }; }; diff --git a/modules/services/keepassx.nix b/modules/services/keepassx.nix index 0ed90dd04..ff875ee63 100644 --- a/modules/services/keepassx.nix +++ b/modules/services/keepassx.nix @@ -13,6 +13,8 @@ with lib; systemd.user.services.keepassx = { Unit = { Description = "KeePassX password manager"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Install = { diff --git a/modules/services/network-manager-applet.nix b/modules/services/network-manager-applet.nix index a7a90b618..eca5515f2 100644 --- a/modules/services/network-manager-applet.nix +++ b/modules/services/network-manager-applet.nix @@ -13,6 +13,8 @@ with lib; systemd.user.services.network-manager-applet = { Unit = { Description = "Network Manager applet"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Install = { diff --git a/modules/services/random-background.nix b/modules/services/random-background.nix index c221740ca..f1b8d39d1 100644 --- a/modules/services/random-background.nix +++ b/modules/services/random-background.nix @@ -42,6 +42,8 @@ in systemd.user.services.random-background = { Unit = { Description = "Set random desktop background using feh"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { diff --git a/modules/services/redshift.nix b/modules/services/redshift.nix index f89786134..ba9f3b1d3 100644 --- a/modules/services/redshift.nix +++ b/modules/services/redshift.nix @@ -99,6 +99,8 @@ in { systemd.user.services.redshift = { Unit = { Description = "Redshift colour temperature adjuster"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Install = { diff --git a/modules/services/taffybar.nix b/modules/services/taffybar.nix index 87a840634..a452295f2 100644 --- a/modules/services/taffybar.nix +++ b/modules/services/taffybar.nix @@ -27,6 +27,8 @@ in systemd.user.services.taffybar = { Unit = { Description = "Taffybar desktop bar"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { diff --git a/modules/services/udiskie.nix b/modules/services/udiskie.nix index 981400caa..b2a2b4072 100644 --- a/modules/services/udiskie.nix +++ b/modules/services/udiskie.nix @@ -13,6 +13,8 @@ with lib; systemd.user.services.udiskie = { Unit = { Description = "Udiskie mount daemon"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { diff --git a/modules/services/xscreensaver.nix b/modules/services/xscreensaver.nix index 0b1a4573a..b27e5b73a 100644 --- a/modules/services/xscreensaver.nix +++ b/modules/services/xscreensaver.nix @@ -13,6 +13,8 @@ with lib; systemd.user.services.xscreensaver = { Unit = { Description = "XScreenSaver"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { diff --git a/modules/xsession.nix b/modules/xsession.nix index 7f0991f1b..6afb17ba1 100644 --- a/modules/xsession.nix +++ b/modules/xsession.nix @@ -38,6 +38,8 @@ in systemd.user.services.setxkbmap = { Unit = { Description = "Set up keyboard in X"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; Install = {