diff --git a/hosts/common/programs/calls.nix b/hosts/common/programs/calls.nix index cc1efaf1..00219376 100644 --- a/hosts/common/programs/calls.nix +++ b/hosts/common/programs/calls.nix @@ -47,12 +47,11 @@ in wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; serviceConfig = { # add --verbose for more debugging - ExecStart = "${cfg.package}/bin/gnome-calls --daemon"; + ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/gnome-calls --daemon"; Type = "simple"; Restart = "always"; RestartSec = "10s"; }; - environment.G_MESSAGES_DEBUG = "all"; }; }; programs.calls = lib.mkIf cfg.enabled { diff --git a/hosts/common/programs/dino.nix b/hosts/common/programs/dino.nix index d25fd34d..e5962e5d 100644 --- a/hosts/common/programs/dino.nix +++ b/hosts/common/programs/dino.nix @@ -73,21 +73,19 @@ in wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/dino"; + # audio buffering; see: + # 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"; Restart = "always"; RestartSec = "20s"; }; - - # audio buffering; see: - # 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. - environment.PULSE_LATENCY_MSEC = "20"; - - # note that debug logging during calls produces so much journal spam that it pegs the CPU and causes dropped audio - # environment.G_MESSAGES_DEBUG = "all"; }; }; } diff --git a/hosts/common/programs/feedbackd.nix b/hosts/common/programs/feedbackd.nix index c188401e..c521580e 100644 --- a/hosts/common/programs/feedbackd.nix +++ b/hosts/common/programs/feedbackd.nix @@ -98,16 +98,18 @@ in 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 = "${cfg.package}/libexec/feedbackd"; + ExecStart = lib.escapeShellArgs ([ + "env" + "G_MESSAGES_DEBUG=all" + ] ++ lib.optionals cfg.config.proxied [ + "FEEDBACK_THEME=$HOME/.config/feedbackd/themes/proxied.json" + ] ++ [ + "${cfg.package}/libexec/feedbackd" + ]); Type = "simple"; Restart = "on-failure"; RestartSec = "10s"; }; - environment = { - G_MESSAGES_DEBUG = "all"; - } // (lib.optionalAttrs cfg.config.proxied { - FEEDBACK_THEME = "/home/colin/.config/feedbackd/themes/proxied.json"; - }); }; }; diff --git a/hosts/common/programs/fractal.nix b/hosts/common/programs/fractal.nix index 59ed653e..7eb86b1a 100644 --- a/hosts/common/programs/fractal.nix +++ b/hosts/common/programs/fractal.nix @@ -73,12 +73,12 @@ in wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; serviceConfig = { + # env "G_MESSAGES_DEBUG=all" ExecStart = "${cfg.package}/bin/fractal"; Type = "simple"; Restart = "always"; RestartSec = "20s"; }; - # environment.G_MESSAGES_DEBUG = "all"; }; }; } diff --git a/hosts/common/programs/pipewire.nix b/hosts/common/programs/pipewire.nix index 73a58ca0..c8032c32 100644 --- a/hosts/common/programs/pipewire.nix +++ b/hosts/common/programs/pipewire.nix @@ -33,6 +33,8 @@ in after = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ]; serviceConfig = { + # env PIPEWIRE_LOG_SYSTEMD=false" + # env PIPEWIRE_DEBUG"*:3,mod.raop*:5,pw.rtsp-client*:5" ExecStart = "${cfg.package}/bin/pipewire"; ExecStartPost = pkgs.writeShellScript "pipewire-wait-started" '' waitFor() { @@ -48,9 +50,6 @@ in Restart = "always"; RestartSec = "5s"; }; - - # environment.PIPEWIRE_LOG_SYSTEMD = "false"; - # environment.PIPEWIRE_DEBUG = "*:3,mod.raop*:5,pw.rtsp-client*:5"; }; services.pipewire-pulse = { description = "pipewire-pulse: Pipewire compatibility layer for PulseAudio clients"; diff --git a/hosts/common/programs/signal-desktop.nix b/hosts/common/programs/signal-desktop.nix index bd7c3a21..b8c262b1 100644 --- a/hosts/common/programs/signal-desktop.nix +++ b/hosts/common/programs/signal-desktop.nix @@ -51,13 +51,12 @@ in wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/signal-desktop"; + # 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"; Restart = "always"; RestartSec = "20s"; }; - # for some reason the --ozone-platform-hint=auto flag fails when signal-desktop is launched from a service - environment.NIXOS_OZONE_WL = "1"; }; }; } diff --git a/hosts/common/programs/sway-autoscaler/default.nix b/hosts/common/programs/sway-autoscaler/default.nix index b4f3eab5..9db68c49 100644 --- a/hosts/common/programs/sway-autoscaler/default.nix +++ b/hosts/common/programs/sway-autoscaler/default.nix @@ -33,12 +33,17 @@ in description = "adjust global desktop scale to match the activate application"; wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/sway-autoscaler --loop-sec ${builtins.toString cfg.config.interval}"; + 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"; Restart = "always"; RestartSec = "10s"; }; - environment.SWAY_DEFAULT_SCALE = builtins.toString cfg.config.defaultScale; }; }; } diff --git a/hosts/common/programs/swaynotificationcenter/default.nix b/hosts/common/programs/swaynotificationcenter/default.nix index 945e6808..3e4ec06b 100644 --- a/hosts/common/programs/swaynotificationcenter/default.nix +++ b/hosts/common/programs/swaynotificationcenter/default.nix @@ -479,13 +479,12 @@ in wantedBy = [ "graphical-session.target" ]; serviceConfig = { - ExecStart = "${cfg.package}/bin/swaync"; + ExecStart = "env G_MESSAGES_DEBUG=all ${cfg.package}/bin/swaync"; Type = "simple"; # BusName = "org.freedesktop.Notifications"; Restart = "on-failure"; RestartSec = "10s"; }; - environment.G_MESSAGES_DEBUG = "all"; }; }; diff --git a/hosts/common/programs/waybar/default.nix b/hosts/common/programs/waybar/default.nix index 69e3c97e..77a87037 100644 --- a/hosts/common/programs/waybar/default.nix +++ b/hosts/common/programs/waybar/default.nix @@ -120,12 +120,12 @@ in wantedBy = [ "graphical-session.target" ]; serviceConfig = { + # env G_MESSAGES_DEBUG=all ExecStart = "${cfg.package}/bin/waybar"; Type = "simple"; Restart = "on-failure"; RestartSec = "10s"; }; - # environment.G_MESSAGES_DEBUG = "all"; }; }; } diff --git a/hosts/common/programs/wvkbd.nix b/hosts/common/programs/wvkbd.nix index beabe50d..b1e38af5 100644 --- a/hosts/common/programs/wvkbd.nix +++ b/hosts/common/programs/wvkbd.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let cfg = config.sane.programs.wvkbd; in @@ -22,32 +22,35 @@ in wantedBy = [ "graphical-session.target" ]; serviceConfig = { # --hidden: send SIGUSR2 to unhide - ExecStart = "${cfg.package}/bin/wvkbd-mobintl --hidden"; + 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"; Restart = "always"; RestartSec = "3s"; }; - - # 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 - environment.WVKBD_LANDSCAPE_LAYERS = "landscape,special,emoji"; - environment.WVKBD_LAYERS = "full,special,emoji"; - environment.WVKBD_HEIGHT = "216"; #< default: 250 (pixels) - # environment.WVKBD_LANDSCAPE_HEIGHT = "??"; #< default: 120 (pixels) - # more settings tunable inside config.h when compiling: - # - KBD_KEY_BORDER = 2 }; }; } diff --git a/hosts/common/programs/xdg-desktop-portal.nix b/hosts/common/programs/xdg-desktop-portal.nix index e7606836..a579eccd 100644 --- a/hosts/common/programs/xdg-desktop-portal.nix +++ b/hosts/common/programs/xdg-desktop-portal.nix @@ -64,16 +64,17 @@ in # i can actually almost omit it today; problem is that if you don't set it it'll look for `sway-portals.conf` in ~/.config/xdg-desktop-portal # but then will check its *own* output dir for {gtk,wlr}.portal. # arguable if that's a packaging bug, or limitation... - ExecStart=''env XDG_DESKTOP_PORTAL_DIR="$HOME/.config/xdg-desktop-portal" ${cfg.package}/libexec/xdg-desktop-portal''; + ExecStart = lib.escapeShellArgs [ + "env" + "XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal" + # "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"; Restart = "always"; RestartSec = "10s"; }; - - # environment.XDG_DESKTOP_PORTAL_DIR = "%E/xdg-desktop-portal"; - - # environment.G_MESSAGES_DEBUG = "all"; #< also applies to all apps launched by the portal }; services.xdg-permission-store = { @@ -85,13 +86,16 @@ in wantedBy = [ "xdg-desktop-portal.service" ]; serviceConfig = { - ExecStart="${cfg.package}/libexec/xdg-permission-store"; + ExecStart = lib.escapeShellArgs [ + "env" + "XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal" + "${cfg.package}/libexec/xdg-permission-store" + ]; Type = "dbus"; BusName = "org.freedesktop.impl.portal.PermissionStore"; Restart = "always"; RestartSec = "10s"; }; - environment.XDG_DESKTOP_PORTAL_DIR = "%E/xdg-desktop-portal"; }; # also available: ${cfg.package}/libexec/xdg-document-portal # -