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

View File

@@ -125,7 +125,6 @@ in
${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai
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
description = "gnome-calls daemon to monitor incoming SIP calls";
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
# add --verbose for more debugging
ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/gnome-calls --daemon";
Type = "simple";
};
# add --verbose for more debugging
serviceConfig.ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/gnome-calls --daemon";
};
};
programs.calls = lib.mkIf cfg.enabled {

View File

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

View File

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

View File

@@ -72,18 +72,15 @@ in
# partOf = [ "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>
# 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.
# 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.
#
# 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";
ExecStart = "env PULSE_LATENCY_MSEC=20 ${cfg.package}/bin/dino";
Type = "simple";
};
# 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
# 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).
# 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
# env G_MESSAGES_DEBUG = "all";
serviceConfig.ExecStart = "env PULSE_LATENCY_MSEC=20 ${cfg.package}/bin/dino";
};
};
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -56,7 +56,6 @@
wantedBy = [ "graphical-session.target" ];
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)
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"
'';
ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/{pipewire-0,pipewire-0.lock,pipewire-0-manager,pipewire-0-manager.lock}"'';
Type = "simple";
};
};
services.pipewire-pulse = {
@@ -65,7 +64,6 @@ in
waitFor "$XDG_RUNTIME_DIR/pulse/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" ];
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";
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" ];
# wantedBy = [ "graphical-session.target" ];
# serviceConfig = {
# ExecStart = "${config.sane.programs.actkbd.package}/bin/actkbd -c /home/colin/.config/actkbd/actkbd.conf";
# Type = "simple";
# };
# serviceConfig.ExecStart = "${config.sane.programs.actkbd.package}/bin/actkbd -c /home/colin/.config/actkbd/actkbd.conf";
# };
# };

View File

@@ -50,11 +50,8 @@ in
# partOf = [ "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
ExecStart = "env NIXOS_OZONE_WL=1 ${cfg.package}/bin/signal-desktop";
Type = "simple";
};
# 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";
};
};
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -68,18 +68,15 @@ in
after = [ "graphical-session.target" "pipewire-pulse.service" ];
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
serviceConfig = {
# options:
# -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)
# -m N to set the indicator this many pixels in from the edge.
# it considers sway bars, but not window titles
# -{H,W} N to set the height/width of the notifier, in px.
# -i N to set the size of the volume icon
# -P to hide percentage text
ExecStart = "${cfg.package}/bin/sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
Type = "simple";
};
# options:
# -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)
# -m N to set the indicator this many pixels in from the edge.
# it considers sway bars, but not window titles
# -{H,W} N to set the height/width of the notifier, in px.
# -i N to set the size of the volume icon
# -P to hide percentage text
serviceConfig.ExecStart = "${cfg.package}/bin/sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
};
};
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,8 +31,7 @@ in
wantedBy = [ "xdg-desktop-portal.service" ];
serviceConfig = {
ExecStart="${cfg.package}/libexec/xdg-desktop-portal-wlr";
Type = "dbus";
ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-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
"${cfg.package}/libexec/xdg-desktop-portal"
];
Type = "dbus";
BusName = "org.freedesktop.portal.Desktop";
};
};
@@ -89,7 +88,6 @@ in
"XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal"
"${cfg.package}/libexec/xdg-permission-store"
];
Type = "dbus";
BusName = "org.freedesktop.impl.portal.PermissionStore";
};
};

View File

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