programs: configure auto-launching programs to only start *after* graphical-session.target

this ensures they really have their environment
This commit is contained in:
Colin 2024-02-19 12:57:44 +00:00
parent 273b1b84e3
commit da1053d635
10 changed files with 47 additions and 21 deletions

View File

@ -26,14 +26,14 @@
services.conky = {
description = "conky dynamic desktop background";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ]; # propagate stop/restart signal from graphical-session to this unit
wantedBy = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
# serviceConfig.Slice = "session.slice";
};
};
}

View File

@ -65,7 +65,10 @@ in
services.dino = {
description = "dino XMPP client";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/dino";
Type = "simple";

View File

@ -64,8 +64,11 @@ in
suggestedPrograms = [ "gnome-keyring" ];
services.fractal = {
description = "auto-start and maintain fractal Matrix connection";
description = "fractal Matrix client";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/fractal";
Type = "simple";

View File

@ -87,8 +87,11 @@ in
secrets.".config/geary/account_02/geary.ini" = ../../../secrets/common/geary_account_02.ini.bin;
services.geary = {
description = "Geary email client";
description = "geary email client";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/geary";
Type = "simple";

View File

@ -53,8 +53,11 @@ in
];
services.gtkcord4 = {
description = "unofficial Discord chat client";
description = "gtkcord4 Discord client";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/gtkcord4";
Type = "simple";

View File

@ -54,8 +54,6 @@
services.mako = {
description = "mako desktop notification daemon";
wantedBy = [ "graphical-session.target" ];
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
# i'm using means that target's never reached...
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
serviceConfig.Type = "simple";

View File

@ -42,8 +42,11 @@ in
];
services.signal-desktop = {
description = "Signal Messenger";
description = "signal-desktop Signal Messenger client";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/signal-desktop";
Type = "simple";

View File

@ -501,13 +501,18 @@ in
services.swaync = {
# swaync ships its own service, but i want to add `environment` variables and flags for easier debugging.
# seems that's not possible without defining an entire nix-native service (i.e. this).
description = "Swaync desktop notification daemon";
description = "swaynotificationcenter (swaync) desktop notification daemon";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${cfg.package}/bin/swaync";
serviceConfig.Type = "simple";
# serviceConfig.BusName = "org.freedesktop.Notifications";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
serviceConfig = {
ExecStart = "${cfg.package}/bin/swaync";
Type = "simple";
# BusName = "org.freedesktop.Notifications";
Restart = "on-failure";
RestartSec = "10s";
};
environment.G_MESSAGES_DEBUG = "all";
};
};

View File

@ -78,12 +78,17 @@ in
(builtins.readFile ./waybar-style.css) + cfg.config.extra_style;
services.waybar = {
description = "sway header bar";
description = "swaybar graphical header bar/tray for sway";
after = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${cfg.package}/bin/waybar";
serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
serviceConfig = {
ExecStart = "${cfg.package}/bin/waybar";
Type = "simple";
Restart = "on-failure";
RestartSec = "10s";
};
# environment.G_MESSAGES_DEBUG = "all";
};
};

View File

@ -63,8 +63,11 @@ in
'';
services.wob = {
description = "Wayland Overlay Bar (renders volume/backlight levels)";
description = "Wayland Overlay Bar (wob) renders volume/backlight levels when requested";
after = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
# ExecStart = "${cfg.package}/bin/wob";
Type = "simple";
@ -83,7 +86,7 @@ in
};
services.wob-pulse = {
description = "notify wob when pulseaudio volume changes";
description = "wob-pulse: monitor pulseaudio and display volume changes on-screen";
wantedBy = [ "wob.service" ];
serviceConfig = {
ExecStart = "${wob-pulse}/bin/wob-pulse";