programs (assorted): fix wantedBy = "default.target" to be more specific

now GUI apps aren't stuck in a restart loop until sway starts

in particular, signal-desktop can actually be autostarted
This commit is contained in:
Colin 2024-02-02 14:21:57 +00:00
parent 483a1d1780
commit 6151eee8d5
14 changed files with 14 additions and 20 deletions

View File

@ -87,7 +87,7 @@ in
services.abaddon = { services.abaddon = {
description = "unofficial Discord chat client"; description = "unofficial Discord chat client";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/abaddon"; ExecStart = "${cfg.package}/bin/abaddon";
Type = "simple"; Type = "simple";

View File

@ -44,7 +44,7 @@ in
services.gnome-calls = { services.gnome-calls = {
# TODO: prevent gnome-calls from daemonizing when started manually # TODO: prevent gnome-calls from daemonizing when started manually
description = "gnome-calls daemon to monitor incoming SIP calls"; description = "gnome-calls daemon to monitor incoming SIP calls";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
# add --verbose for more debugging # add --verbose for more debugging
ExecStart = "${cfg.package}/bin/gnome-calls --daemon"; ExecStart = "${cfg.package}/bin/gnome-calls --daemon";

View File

@ -23,10 +23,7 @@
services.conky = { services.conky = {
description = "conky dynamic desktop background"; description = "conky dynamic desktop background";
wantedBy = [ "default.target" ]; 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...
# wantedBy = [ "graphical-session.target" ];
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky"; serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
@ -34,9 +31,6 @@
serviceConfig.Restart = "on-failure"; serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s"; serviceConfig.RestartSec = "10s";
# serviceConfig.Slice = "session.slice"; # serviceConfig.Slice = "session.slice";
# don't start conky until after sway
preStart = ''test -n "$SWAYSOCK"'';
}; };
}; };
} }

View File

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

View File

@ -92,7 +92,7 @@ in
services.feedbackd = { services.feedbackd = {
description = "feedbackd audio/vibration/led controller"; description = "feedbackd audio/vibration/led controller";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ]; #< should technically be `sound.target`, but that doesn't seem to get auto-started?
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/libexec/feedbackd"; ExecStart = "${cfg.package}/libexec/feedbackd";
Type = "simple"; Type = "simple";

View File

@ -51,7 +51,7 @@ in
services.fractal = { services.fractal = {
description = "auto-start and maintain fractal Matrix connection"; description = "auto-start and maintain fractal Matrix connection";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/fractal"; ExecStart = "${cfg.package}/bin/fractal";
Type = "simple"; Type = "simple";

View File

@ -85,7 +85,7 @@ in
services.geary = { services.geary = {
description = "Geary email client"; description = "Geary email client";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/geary"; ExecStart = "${cfg.package}/bin/geary";
Type = "simple"; Type = "simple";

View File

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

View File

@ -53,7 +53,7 @@
# on environment.packages, but then logs are blackholed. # on environment.packages, but then logs are blackholed.
services.mako = { services.mako = {
description = "mako desktop notification daemon"; description = "mako desktop notification daemon";
wantedBy = [ "default.target" ]; wantedBy = [ "graphical-session.target" ];
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway # XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
# i'm using means that target's never reached... # i'm using means that target's never reached...

View File

@ -5,7 +5,7 @@
services.playerctld = { services.playerctld = {
description = "playerctl daemon to keep track of which MPRIS players were recently active"; description = "playerctl daemon to keep track of which MPRIS players were recently active";
documentation = [ "https://github.com/altdesktop/playerctl/issues/161" ]; documentation = [ "https://github.com/altdesktop/playerctl/issues/161" ];
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ]; #< TODO: maybe better to zero `wantedBy` here and have the specific consumers (e.g. swaync) explicitly depend on this.
serviceConfig.ExecStart = "${config.sane.programs.playerctl.package}/bin/playerctld"; serviceConfig.ExecStart = "${config.sane.programs.playerctl.package}/bin/playerctld";
# serviceConfig.Type = "dbus"; # serviceConfig.Type = "dbus";
# serviceConfig.BusName = "org.mpris.MediaPlayer2.Player"; # serviceConfig.BusName = "org.mpris.MediaPlayer2.Player";

View File

@ -32,7 +32,7 @@ in
services.signal-desktop = { services.signal-desktop = {
description = "Signal Messenger"; description = "Signal Messenger";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/signal-desktop"; ExecStart = "${cfg.package}/bin/signal-desktop";
Type = "simple"; Type = "simple";

View File

@ -31,7 +31,7 @@ in
services.sway-autoscaler = { services.sway-autoscaler = {
description = "adjust global desktop scale to match the activate application"; description = "adjust global desktop scale to match the activate application";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/sway-autoscaler --loop-sec ${builtins.toString cfg.config.interval}"; ExecStart = "${cfg.package}/bin/sway-autoscaler --loop-sec ${builtins.toString cfg.config.interval}";
Type = "simple"; Type = "simple";

View File

@ -461,7 +461,7 @@ in
# swaync ships its own service, but i want to add `environment` variables and flags for easier debugging. # 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). # seems that's not possible without defining an entire nix-native service (i.e. this).
description = "Swaync desktop notification daemon"; description = "Swaync desktop notification daemon";
wantedBy = [ "default.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${cfg.package}/bin/swaync"; serviceConfig.ExecStart = "${cfg.package}/bin/swaync";
serviceConfig.Type = "simple"; serviceConfig.Type = "simple";
# serviceConfig.BusName = "org.freedesktop.Notifications"; # serviceConfig.BusName = "org.freedesktop.Notifications";

View File

@ -55,7 +55,7 @@ in
services.wob = { services.wob = {
description = "Wayland Overlay Bar (renders volume/backlight levels)"; description = "Wayland Overlay Bar (renders volume/backlight levels)";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
# ExecStart = "${cfg.package}/bin/wob"; # ExecStart = "${cfg.package}/bin/wob";
Type = "simple"; Type = "simple";