users/services: remove serviceConfig.Type option

This commit is contained in:
2024-03-21 05:13:48 +00:00
parent db12e03f64
commit 1417497001
30 changed files with 92 additions and 165 deletions

View File

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

View File

@@ -125,7 +125,6 @@ in
${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai ${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai
exec ${cfg.package}/bin/bonsaid -t ${cfg.config.configFile} exec ${cfg.package}/bin/bonsaid -t ${cfg.config.configFile}
''; '';
serviceConfig.Type = "simple";
}; };
}; };
} }

View File

@@ -45,11 +45,8 @@ in
# 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 [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # add --verbose for more debugging
# add --verbose for more debugging serviceConfig.ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/gnome-calls --daemon";
ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/gnome-calls --daemon";
Type = "simple";
};
}; };
}; };
programs.calls = lib.mkIf cfg.enabled { programs.calls = lib.mkIf cfg.enabled {

View File

@@ -31,7 +31,6 @@
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky"; serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
serviceConfig.Type = "simple";
}; };
}; };
} }

View File

@@ -37,10 +37,7 @@ in
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = "${lib.getLib cfg.package}/libexec/dconf-service";
ExecStart = "${lib.getLib cfg.package}/libexec/dconf-service";
Type = "simple";
};
}; };
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?), # supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),

View File

@@ -72,18 +72,15 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # audio buffering; see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained>
# audio buffering; see: <https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained> # dino defaults to 10ms mic buffer, which causes underruns, which Dino handles *very* poorly
# dino defaults to 10ms mic buffer, which causes underruns, which Dino handles *very* poorly # as in, the other end of the call will just not receive sound from us for a couple seconds.
# as in, the other end of the call will just not receive sound from us for a couple seconds. # pipewire uses power-of-two buffering for the mic itself. that would put us at 21.33 ms, but this env var supports only whole numbers (21ms ends up not power-of-two).
# pipewire uses power-of-two buffering for the mic itself. that would put us at 21.33 ms, but this env var supports only whole numbers (21ms ends up not power-of-two). # also, Dino's likely still doing things in 10ms batches internally anyway.
# also, Dino's likely still doing things in 10ms batches internally anyway. #
# # note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio
# note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio # env G_MESSAGES_DEBUG = "all";
# env G_MESSAGES_DEBUG = "all"; serviceConfig.ExecStart = "env PULSE_LATENCY_MSEC=20 ${cfg.package}/bin/dino";
ExecStart = "env PULSE_LATENCY_MSEC=20 ${cfg.package}/bin/dino";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -60,10 +60,7 @@ in
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = "${cfg.package}/bin/dissent";
ExecStart = "${cfg.package}/bin/dissent";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -103,10 +103,7 @@ in
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = "${cfg.package}/bin/fcitx5";
ExecStart="${cfg.package}/bin/fcitx5";
Type = "simple";
};
}; };
env.XMODIFIERS = "@im=fcitx"; env.XMODIFIERS = "@im=fcitx";

View File

@@ -97,17 +97,14 @@ in
services.feedbackd = { services.feedbackd = {
description = "feedbackd audio/vibration/led controller"; description = "feedbackd audio/vibration/led controller";
wantedBy = [ "default.target" ]; #< should technically be `sound.target`, but that doesn't seem to get auto-started? wantedBy = [ "default.target" ]; #< should technically be `sound.target`, but that doesn't seem to get auto-started?
serviceConfig = { serviceConfig.ExecStart = lib.concatStringsSep " " ([
ExecStart = lib.concatStringsSep " " ([ "env"
"env" "G_MESSAGES_DEBUG=all"
"G_MESSAGES_DEBUG=all" ] ++ lib.optionals cfg.config.proxied [
] ++ lib.optionals cfg.config.proxied [ "FEEDBACK_THEME=$HOME/.config/feedbackd/themes/proxied.json"
"FEEDBACK_THEME=$HOME/.config/feedbackd/themes/proxied.json" ] ++ [
] ++ [ "${cfg.package}/libexec/feedbackd"
"${cfg.package}/libexec/feedbackd" ]);
]);
Type = "simple";
};
}; };
}; };

View File

@@ -72,11 +72,8 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # env "G_MESSAGES_DEBUG=all"
# env "G_MESSAGES_DEBUG=all" serviceConfig.ExecStart = "${cfg.package}/bin/fractal";
ExecStart = "${cfg.package}/bin/fractal";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -91,10 +91,7 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = "${cfg.package}/bin/geary";
ExecStart = "${cfg.package}/bin/geary";
Type = "simple";
};
}; };
}; };

View File

@@ -56,7 +56,6 @@ in
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.package}/bin/gnome-keyring-daemon --start --foreground --components=secrets"; ExecStart = "${cfg.package}/bin/gnome-keyring-daemon --start --foreground --components=secrets";
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -m 0700 -p %t/keyring"; ExecStartPre = "${pkgs.coreutils}/bin/mkdir -m 0700 -p %t/keyring";
Type = "simple";
}; };
}; };
}; };

View File

@@ -56,7 +56,6 @@
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako"; serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
serviceConfig.Type = "simple";
}; };
}; };
} }

View File

@@ -32,7 +32,6 @@ in
topic=$(cat ~/.config/ntfy-sh/topic) topic=$(cat ~/.config/ntfy-sh/topic)
ntfy sub "https://ntfy.uninsane.org:2587/$topic" ntfy sub "https://ntfy.uninsane.org:2587/$topic"
''; '';
serviceConfig.Type = "simple";
}; };
}; };
} }

View File

@@ -46,7 +46,6 @@ in
waitFor "$XDG_RUNTIME_DIR/pipewire-0-manager" waitFor "$XDG_RUNTIME_DIR/pipewire-0-manager"
''; '';
ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/{pipewire-0,pipewire-0.lock,pipewire-0-manager,pipewire-0-manager.lock}"''; ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/{pipewire-0,pipewire-0.lock,pipewire-0-manager,pipewire-0-manager.lock}"'';
Type = "simple";
}; };
}; };
services.pipewire-pulse = { services.pipewire-pulse = {
@@ -65,7 +64,6 @@ in
waitFor "$XDG_RUNTIME_DIR/pulse/pid" waitFor "$XDG_RUNTIME_DIR/pulse/pid"
''; '';
ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/pulse/{native,pid}"''; ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/pulse/{native,pid}"'';
Type = "simple";
}; };
}; };
}; };

View File

@@ -10,9 +10,7 @@
documentation = [ "https://github.com/altdesktop/playerctl/issues/161" ]; documentation = [ "https://github.com/altdesktop/playerctl/issues/161" ];
wantedBy = [ "default.target" ]; #< TODO: maybe better to zero `wantedBy` here and have the specific consumers (e.g. swaync) explicitly depend on this. 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.BusName = "org.mpris.MediaPlayer2.Player"; # serviceConfig.BusName = "org.mpris.MediaPlayer2.Player";
serviceConfig.Type = "simple"; # playerctl also supports a --daemon option, idk if that's better
}; };
}; };
} }

View File

@@ -127,10 +127,7 @@ in
# after = [ "graphical-session.target" ]; # after = [ "graphical-session.target" ];
# wantedBy = [ "graphical-session.target" ]; # wantedBy = [ "graphical-session.target" ];
# serviceConfig = { # serviceConfig.ExecStart = "${config.sane.programs.actkbd.package}/bin/actkbd -c /home/colin/.config/actkbd/actkbd.conf";
# ExecStart = "${config.sane.programs.actkbd.package}/bin/actkbd -c /home/colin/.config/actkbd/actkbd.conf";
# Type = "simple";
# };
# }; # };
# }; # };

View File

@@ -50,11 +50,8 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # for some reason the --ozone-platform-hint=auto flag fails when signal-desktop is launched from a service
# for some reason the --ozone-platform-hint=auto flag fails when signal-desktop is launched from a service serviceConfig.ExecStart = "env NIXOS_OZONE_WL=1 ${cfg.package}/bin/signal-desktop";
ExecStart = "env NIXOS_OZONE_WL=1 ${cfg.package}/bin/signal-desktop";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -32,16 +32,13 @@ 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 [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = lib.escapeShellArgs [
ExecStart = lib.escapeShellArgs [ "env"
"env" "SWAY_DEFAULT_SCALE=${builtins.toString cfg.config.defaultScale}"
"SWAY_DEFAULT_SCALE=${builtins.toString cfg.config.defaultScale}" "${cfg.package}/bin/sway-autoscaler"
"${cfg.package}/bin/sway-autoscaler" "--loop-sec"
"--loop-sec" (builtins.toString cfg.config.interval)
(builtins.toString cfg.config.interval) ];
];
Type = "simple";
};
}; };
}; };
} }

View File

@@ -254,10 +254,7 @@ in
services.sway = { services.sway = {
description = "sway: tiling wayland desktop environment"; description = "sway: tiling wayland desktop environment";
wantedBy = [ "default.target" ]; wantedBy = [ "default.target" ];
serviceConfig = { serviceConfig.ExecStart = "${cfg.package}/bin/sway";
ExecStart = "${cfg.package}/bin/sway";
Type = "simple";
};
}; };
}; };

View File

@@ -57,23 +57,20 @@ in
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = lib.escapeShellArgs (
ExecStart = lib.escapeShellArgs ( [
[ "${cfg.package}/bin/swayidle"
"${cfg.package}/bin/swayidle" "-w"
"-w" ] ++ lib.flatten (
] ++ lib.flatten ( lib.mapAttrsToList
lib.mapAttrsToList (_: { command, delay, enable, ... }: lib.optionals enable [
(_: { command, delay, enable, ... }: lib.optionals enable [ "timeout"
"timeout" (builtins.toString delay)
(builtins.toString delay) command
command ])
]) cfg.config.actions
cfg.config.actions )
) );
);
Type = "simple";
};
}; };
}; };
} }

View File

@@ -478,11 +478,8 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/swaync";
ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/swaync"; # serviceConfig.BusName = "org.freedesktop.Notifications";
Type = "simple";
# BusName = "org.freedesktop.Notifications";
};
}; };
}; };

View File

@@ -68,18 +68,15 @@ in
after = [ "graphical-session.target" "pipewire-pulse.service" ]; after = [ "graphical-session.target" "pipewire-pulse.service" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = { # options:
# options: # -p {0,1,2,3} to attach to top/right/bottom/left screen edge
# -p {0,1,2,3} to attach to top/right/bottom/left screen edge # -t N for the notifier to be dismissed after N seconds (integer only)
# -t N for the notifier to be dismissed after N seconds (integer only) # -m N to set the indicator this many pixels in from the edge.
# -m N to set the indicator this many pixels in from the edge. # it considers sway bars, but not window titles
# it considers sway bars, but not window titles # -{H,W} N to set the height/width of the notifier, in px.
# -{H,W} N to set the height/width of the notifier, in px. # -i N to set the size of the volume icon
# -i N to set the size of the volume icon # -P to hide percentage text
# -P to hide percentage text serviceConfig.ExecStart = "${cfg.package}/bin/sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
ExecStart = "${cfg.package}/bin/sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -119,11 +119,8 @@ in
# partOf = [ "graphical-session.target" ]; # partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { # env G_MESSAGES_DEBUG=all
# env G_MESSAGES_DEBUG=all serviceConfig.ExecStart = "${cfg.package}/bin/waybar";
ExecStart = "${cfg.package}/bin/waybar";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -37,10 +37,7 @@ in
after = [ "pipewire.service" ]; after = [ "pipewire.service" ];
bindsTo = [ "pipewire.service" ]; bindsTo = [ "pipewire.service" ];
wantedBy = [ "pipewire.service" ]; wantedBy = [ "pipewire.service" ];
serviceConfig = { serviceConfig.ExecStart = "${cfg.package}/bin/wireplumber";
ExecStart = "${cfg.package}/bin/wireplumber";
Type = "simple";
};
}; };
}; };
} }

View File

@@ -20,35 +20,32 @@ in
description = "wvkbd: wayland virtual keyboard"; description = "wvkbd: wayland virtual keyboard";
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
serviceConfig = { serviceConfig.ExecStart = lib.escapeShellArgs [
"env"
# --hidden: send SIGUSR2 to unhide # --hidden: send SIGUSR2 to unhide
ExecStart = lib.escapeShellArgs [ # wvkbd layers:
"env" # - full
# wvkbd layers: # - landscape
# - full # - special (e.g. coding symbols like ~)
# - landscape # - emoji
# - special (e.g. coding symbols like ~) # - nav
# - emoji # - simple (like landscape, but no parens/tab/etc; even fewer chars)
# - nav # - simplegrid (simple, but grid layout)
# - simple (like landscape, but no parens/tab/etc; even fewer chars) # - dialer (digits)
# - simplegrid (simple, but grid layout) # - cyrillic
# - dialer (digits) # - arabic
# - cyrillic # - persian
# - arabic # - greek
# - persian # - georgian
# - greek "WVKBD_LANDSCAPE_LAYERS=landscape,special,emoji"
# - georgian "WVKBD_LAYERS=full,special,emoji"
"WVKBD_LANDSCAPE_LAYERS=landscape,special,emoji" "WVKBD_HEIGHT=216" #< default: 250 (pixels)
"WVKBD_LAYERS=full,special,emoji" # "WVKBD_LANDSCAPE_HEIGHT=??" #< default: 120 (pixels)
"WVKBD_HEIGHT=216" #< default: 250 (pixels) # more settings tunable inside config.h when compiling:
# "WVKBD_LANDSCAPE_HEIGHT=??" #< default: 120 (pixels) # - KBD_KEY_BORDER = 2
# more settings tunable inside config.h when compiling: "${cfg.package}/bin/wvkbd-mobintl"
# - KBD_KEY_BORDER = 2 "--hidden"
"${cfg.package}/bin/wvkbd-mobintl" ];
"--hidden"
];
Type = "simple";
};
}; };
}; };
} }

View File

@@ -46,8 +46,7 @@ in
wantedBy = [ "xdg-desktop-portal.service" ]; wantedBy = [ "xdg-desktop-portal.service" ];
serviceConfig = { serviceConfig = {
ExecStart="${cfg.package}/libexec/xdg-desktop-portal-gtk"; ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-gtk";
Type = "dbus";
BusName = "org.freedesktop.impl.portal.desktop.gtk"; BusName = "org.freedesktop.impl.portal.desktop.gtk";
}; };
}; };

View File

@@ -31,8 +31,7 @@ in
wantedBy = [ "xdg-desktop-portal.service" ]; wantedBy = [ "xdg-desktop-portal.service" ];
serviceConfig = { serviceConfig = {
ExecStart="${cfg.package}/libexec/xdg-desktop-portal-wlr"; ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-wlr";
Type = "dbus";
BusName = "org.freedesktop.impl.portal.desktop.wlr"; BusName = "org.freedesktop.impl.portal.desktop.wlr";
}; };
}; };

View File

@@ -70,7 +70,6 @@ in
# "G_MESSAGES_DEBUG=all" #< also applies to all apps launched by the portal # "G_MESSAGES_DEBUG=all" #< also applies to all apps launched by the portal
"${cfg.package}/libexec/xdg-desktop-portal" "${cfg.package}/libexec/xdg-desktop-portal"
]; ];
Type = "dbus";
BusName = "org.freedesktop.portal.Desktop"; BusName = "org.freedesktop.portal.Desktop";
}; };
}; };
@@ -89,7 +88,6 @@ in
"XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal" "XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal"
"${cfg.package}/libexec/xdg-permission-store" "${cfg.package}/libexec/xdg-permission-store"
]; ];
Type = "dbus";
BusName = "org.freedesktop.impl.portal.PermissionStore"; BusName = "org.freedesktop.impl.portal.PermissionStore";
}; };
}; };

View File

@@ -42,9 +42,6 @@ let
default = null; default = null;
}; };
serviceConfig.Type = mkOption {
type = types.enum [ "dbus" "simple" ];
};
serviceConfig.ExecStart = mkOption { serviceConfig.ExecStart = mkOption {
type = types.nullOr (types.coercedTo types.package toString types.str); type = types.nullOr (types.coercedTo types.package toString types.str);
default = null; default = null;