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 = {
description = "unofficial Discord chat client";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/abaddon";
Type = "simple";

View File

@ -44,7 +44,7 @@ in
services.gnome-calls = {
# TODO: prevent gnome-calls from daemonizing when started manually
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 = {
# add --verbose for more debugging
ExecStart = "${cfg.package}/bin/gnome-calls --daemon";

View File

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

View File

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

View File

@ -92,7 +92,7 @@ in
services.feedbackd = {
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 = {
ExecStart = "${cfg.package}/libexec/feedbackd";
Type = "simple";

View File

@ -51,7 +51,7 @@ in
services.fractal = {
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 = {
ExecStart = "${cfg.package}/bin/fractal";
Type = "simple";

View File

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

View File

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

View File

@ -53,7 +53,7 @@
# on environment.packages, but then logs are blackholed.
services.mako = {
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
# i'm using means that target's never reached...

View File

@ -5,7 +5,7 @@
services.playerctld = {
description = "playerctl daemon to keep track of which MPRIS players were recently active";
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.Type = "dbus";
# serviceConfig.BusName = "org.mpris.MediaPlayer2.Player";

View File

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

View File

@ -31,7 +31,7 @@ in
services.sway-autoscaler = {
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 = {
ExecStart = "${cfg.package}/bin/sway-autoscaler --loop-sec ${builtins.toString cfg.config.interval}";
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.
# seems that's not possible without defining an entire nix-native service (i.e. this).
description = "Swaync desktop notification daemon";
wantedBy = [ "default.target" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${cfg.package}/bin/swaync";
serviceConfig.Type = "simple";
# serviceConfig.BusName = "org.freedesktop.Notifications";

View File

@ -55,7 +55,7 @@ in
services.wob = {
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 = {
# ExecStart = "${cfg.package}/bin/wob";
Type = "simple";