users/services: refactor: replace ExecStart/ExecStopPost with command/cleanupCommand
note that this completely breaks the systemd backend (though easily fixable if wanted)
This commit is contained in:
@@ -88,7 +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.ExecStart = "abaddon";
|
command = "abaddon";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -121,8 +121,8 @@ in
|
|||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.ExecStart = "bonsaid -t ${cfg.config.configFile}";
|
command = "bonsaid -t ${cfg.config.configFile}";
|
||||||
serviceConfig.ExecStopPost = "rm -f $XDG_RUNTIME_DIR/bonsai";
|
cleanupCommand = "rm -f $XDG_RUNTIME_DIR/bonsai";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ in
|
|||||||
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" ];
|
||||||
# add --verbose for more debugging
|
# add --verbose for more debugging
|
||||||
serviceConfig.ExecStart = "env G_MESSAGES_DEBUG=all gnome-calls --daemon";
|
command = "env G_MESSAGES_DEBUG=all gnome-calls --daemon";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.calls = lib.mkIf cfg.enabled {
|
programs.calls = lib.mkIf cfg.enabled {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
sane.programs.conky = {
|
sane.programs.conky = {
|
||||||
# TODO: non-sandboxed `conky` still ships via `sxmo-utils`, but unused
|
# TODO: non-sandboxed `conky` still ships via `sxmo-utils`, but unused
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
fs.".config/conky/conky.conf".symlink.target =
|
fs.".config/conky/conky.conf".symlink.target =
|
||||||
let
|
let
|
||||||
|
# TODO: make this just another `suggestedPrograms`!
|
||||||
battery_estimate = pkgs.static-nix-shell.mkBash {
|
battery_estimate = pkgs.static-nix-shell.mkBash {
|
||||||
pname = "battery_estimate";
|
pname = "battery_estimate";
|
||||||
srcRoot = ./.;
|
srcRoot = ./.;
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
# partOf = [ "graphical-session.target" ]; # propagate stop/restart signal from graphical-session to this unit
|
# partOf = [ "graphical-session.target" ]; # propagate stop/restart signal from graphical-session to this unit
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.ExecStart = "${config.sane.programs.conky.package}/bin/conky";
|
command = "conky";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -36,8 +36,7 @@ in
|
|||||||
description = "dconf configuration database/server";
|
description = "dconf configuration database/server";
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
command = "${lib.getLib cfg.package}/libexec/dconf-service";
|
||||||
serviceConfig.ExecStart = "${lib.getLib cfg.package}/libexec/dconf-service";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),
|
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),
|
||||||
|
@@ -80,7 +80,7 @@ in
|
|||||||
#
|
#
|
||||||
# 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 dino";
|
command = "env PULSE_LATENCY_MSEC=20 dino";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -59,8 +59,7 @@ in
|
|||||||
description = "dissent Discord client";
|
description = "dissent Discord client";
|
||||||
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" ];
|
||||||
|
command = "dissent";
|
||||||
serviceConfig.ExecStart = "dissent";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -100,7 +100,7 @@
|
|||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.ExecStart = "fcitx5";
|
command = "fcitx5";
|
||||||
};
|
};
|
||||||
|
|
||||||
env.XMODIFIERS = "@im=fcitx";
|
env.XMODIFIERS = "@im=fcitx";
|
||||||
|
@@ -97,7 +97,7 @@ 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.ExecStart = lib.concatStringsSep " " ([
|
command = lib.concatStringsSep " " ([
|
||||||
"env"
|
"env"
|
||||||
"G_MESSAGES_DEBUG=all"
|
"G_MESSAGES_DEBUG=all"
|
||||||
] ++ lib.optionals cfg.config.proxied [
|
] ++ lib.optionals cfg.config.proxied [
|
||||||
|
@@ -73,7 +73,7 @@ in
|
|||||||
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
||||||
|
|
||||||
# env "G_MESSAGES_DEBUG=all"
|
# env "G_MESSAGES_DEBUG=all"
|
||||||
serviceConfig.ExecStart = "fractal";
|
command = "fractal";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -90,8 +90,7 @@ in
|
|||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
# 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" ];
|
||||||
|
command = "geary";
|
||||||
serviceConfig.ExecStart = "geary";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -50,9 +50,9 @@
|
|||||||
description = "gnome-keyring-daemon: secret provider";
|
description = "gnome-keyring-daemon: secret provider";
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
serviceConfig.ExecStart = let
|
command = let
|
||||||
gkr-start = pkgs.writeShellScriptBin "gnome-keyring-daemon-start" ''
|
gkr-start = pkgs.writeShellScriptBin "gnome-keyring-daemon-start" ''
|
||||||
mkdir -m 0700 -p %t/keyring
|
mkdir -m 0700 -p $XDG_RUNTIME_DIR/keyring
|
||||||
exec gnome-keyring-daemon --start --foreground --components=secrets
|
exec gnome-keyring-daemon --start --foreground --components=secrets
|
||||||
'';
|
'';
|
||||||
in "${gkr-start}/bin/gnome-keyring-daemon-start";
|
in "${gkr-start}/bin/gnome-keyring-daemon-start";
|
||||||
|
@@ -54,8 +54,7 @@
|
|||||||
services.mako = {
|
services.mako = {
|
||||||
description = "mako desktop notification daemon";
|
description = "mako desktop notification daemon";
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
command = "${config.sane.programs.mako.package}/bin/mako";
|
||||||
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ in
|
|||||||
services.ntfy-sub = {
|
services.ntfy-sub = {
|
||||||
description = "listen for push-notifications";
|
description = "listen for push-notifications";
|
||||||
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
|
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
|
||||||
serviceConfig.ExecStart = let
|
command = let
|
||||||
sub = pkgs.writeShellScriptBin "ntfy-sub" ''
|
sub = pkgs.writeShellScriptBin "ntfy-sub" ''
|
||||||
topic=$(cat ~/.config/ntfy-sh/topic)
|
topic=$(cat ~/.config/ntfy-sh/topic)
|
||||||
exec ntfy sub "https://ntfy.uninsane.org:2587/$topic"
|
exec ntfy sub "https://ntfy.uninsane.org:2587/$topic"
|
||||||
|
@@ -32,39 +32,25 @@ in
|
|||||||
description = "pipewire: multimedia service";
|
description = "pipewire: multimedia service";
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
serviceConfig = {
|
# env PIPEWIRE_LOG_SYSTEMD=false"
|
||||||
# env PIPEWIRE_LOG_SYSTEMD=false"
|
# env PIPEWIRE_DEBUG"*:3,mod.raop*:5,pw.rtsp-client*:5"
|
||||||
# env PIPEWIRE_DEBUG"*:3,mod.raop*:5,pw.rtsp-client*:5"
|
command = "pipewire";
|
||||||
ExecStart = "pipewire";
|
pollReadyCommand = pkgs.writeShellScript "pipewire-wait-started" ''
|
||||||
ExecStartPost = pkgs.writeShellScript "pipewire-wait-started" ''
|
[ -e "$XDG_RUNTIME_DIR/pipewire-0" ] && \
|
||||||
waitFor() {
|
[ -e "$XDG_RUNTIME_DIR/pipewire-0-manager" ]
|
||||||
while [ ! -e "$1" ]; do
|
'';
|
||||||
sleep 1
|
cleanupCommand = ''rm -f "$XDG_RUNTIME_DIR/{pipewire-0,pipewire-0.lock,pipewire-0-manager,pipewire-0-manager.lock}"'';
|
||||||
done
|
|
||||||
}
|
|
||||||
waitFor "$XDG_RUNTIME_DIR/pipewire-0"
|
|
||||||
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}"'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
services.pipewire-pulse = {
|
services.pipewire-pulse = {
|
||||||
description = "pipewire-pulse: Pipewire compatibility layer for PulseAudio clients";
|
description = "pipewire-pulse: Pipewire compatibility layer for PulseAudio clients";
|
||||||
after = [ "pipewire.service" ];
|
after = [ "pipewire.service" ];
|
||||||
wantedBy = [ "pipewire.service" ];
|
wantedBy = [ "pipewire.service" ];
|
||||||
serviceConfig = {
|
command = "pipewire-pulse";
|
||||||
ExecStart = "pipewire-pulse";
|
pollReadyCommand = pkgs.writeShellScript "pipewire-pulse-wait-started" ''
|
||||||
ExecStartPost = pkgs.writeShellScript "pipewire-pulse-wait-started" ''
|
[ -e "$XDG_RUNTIME_DIR/pulse/native" ] && \
|
||||||
waitFor() {
|
[ -e "$XDG_RUNTIME_DIR/pulse/pid" ]
|
||||||
while [ ! -e "$1" ]; do
|
'';
|
||||||
sleep 1
|
cleanupCommand = ''rm -f "$XDG_RUNTIME_DIR/pulse/{native,pid}"'';
|
||||||
done
|
|
||||||
}
|
|
||||||
waitFor "$XDG_RUNTIME_DIR/pulse/native"
|
|
||||||
waitFor "$XDG_RUNTIME_DIR/pulse/pid"
|
|
||||||
'';
|
|
||||||
ExecStopPost = ''rm -f "$XDG_RUNTIME_DIR/pulse/{native,pid}"'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
sane.programs.playerctl = {
|
sane.programs.playerctl = {
|
||||||
sandbox.method = "bwrap";
|
sandbox.method = "bwrap";
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
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" ]; #< 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";
|
command = "playerctld";
|
||||||
# serviceConfig.BusName = "org.mpris.MediaPlayer2.Player";
|
# serviceConfig.BusName = "org.mpris.MediaPlayer2.Player";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -51,7 +51,7 @@ in
|
|||||||
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
||||||
|
|
||||||
# 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 signal-desktop";
|
command = "env NIXOS_OZONE_WL=1 signal-desktop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,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 [ "graphical-session.target" ];
|
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
||||||
serviceConfig.ExecStart = lib.escapeShellArgs [
|
command = lib.escapeShellArgs [
|
||||||
"env"
|
"env"
|
||||||
"SWAY_DEFAULT_SCALE=${builtins.toString cfg.config.defaultScale}"
|
"SWAY_DEFAULT_SCALE=${builtins.toString cfg.config.defaultScale}"
|
||||||
"sway-autoscaler"
|
"sway-autoscaler"
|
||||||
|
@@ -254,7 +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.ExecStart = "sway";
|
command = "sway";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ in
|
|||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.ExecStart = lib.escapeShellArgs (
|
command = lib.escapeShellArgs (
|
||||||
[
|
[
|
||||||
"swayidle"
|
"swayidle"
|
||||||
"-w"
|
"-w"
|
||||||
|
@@ -478,7 +478,7 @@ in
|
|||||||
# partOf = [ "graphical-session.target" ];
|
# partOf = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig.ExecStart = "env G_MESSAGES_DEBUG=all swaync";
|
command = "env G_MESSAGES_DEBUG=all swaync";
|
||||||
# serviceConfig.BusName = "org.freedesktop.Notifications";
|
# serviceConfig.BusName = "org.freedesktop.Notifications";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -63,7 +63,7 @@
|
|||||||
# -{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 = "sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
|
command = "sysvol -p 0 -t 1 -m 22 -H 39 -W 256 -i 32 -P";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -120,7 +120,7 @@ in
|
|||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
# env G_MESSAGES_DEBUG=all
|
# env G_MESSAGES_DEBUG=all
|
||||||
serviceConfig.ExecStart = "waybar";
|
command = "waybar";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
after = [ "pipewire.service" ];
|
after = [ "pipewire.service" ];
|
||||||
bindsTo = [ "pipewire.service" ];
|
bindsTo = [ "pipewire.service" ];
|
||||||
wantedBy = [ "pipewire.service" ];
|
wantedBy = [ "pipewire.service" ];
|
||||||
serviceConfig.ExecStart = "wireplumber";
|
command = "wireplumber";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
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.ExecStart = lib.escapeShellArgs [
|
command = lib.escapeShellArgs [
|
||||||
"env"
|
"env"
|
||||||
# --hidden: send SIGUSR2 to unhide
|
# --hidden: send SIGUSR2 to unhide
|
||||||
# wvkbd layers:
|
# wvkbd layers:
|
||||||
|
@@ -45,10 +45,8 @@ in
|
|||||||
before = [ "xdg-desktop-portal.service" ];
|
before = [ "xdg-desktop-portal.service" ];
|
||||||
wantedBy = [ "xdg-desktop-portal.service" ];
|
wantedBy = [ "xdg-desktop-portal.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
command = "${cfg.package}/libexec/xdg-desktop-portal-gtk";
|
||||||
ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-gtk";
|
serviceConfig.BusName = "org.freedesktop.impl.portal.desktop.gtk";
|
||||||
BusName = "org.freedesktop.impl.portal.desktop.gtk";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -30,10 +30,8 @@ in
|
|||||||
before = [ "xdg-desktop-portal.service" ];
|
before = [ "xdg-desktop-portal.service" ];
|
||||||
wantedBy = [ "xdg-desktop-portal.service" ];
|
wantedBy = [ "xdg-desktop-portal.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
command = "${cfg.package}/libexec/xdg-desktop-portal-wlr";
|
||||||
ExecStart = "${cfg.package}/libexec/xdg-desktop-portal-wlr";
|
serviceConfig.BusName = "org.freedesktop.impl.portal.desktop.wlr";
|
||||||
BusName = "org.freedesktop.impl.portal.desktop.wlr";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -58,20 +58,18 @@ in
|
|||||||
# partOf = [ "graphical-session.target" ];
|
# partOf = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
# tracking issue for having xdg-desktop-portal locate portals via more standard directories, obviating this var:
|
||||||
# tracking issue for having xdg-desktop-portal locate portals via more standard directories, obviating this var:
|
# - <https://github.com/flatpak/xdg-desktop-portal/issues/603>
|
||||||
# - <https://github.com/flatpak/xdg-desktop-portal/issues/603>
|
# 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
|
||||||
# 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.
|
||||||
# but then will check its *own* output dir for {gtk,wlr}.portal.
|
# arguable if that's a packaging bug, or limitation...
|
||||||
# arguable if that's a packaging bug, or limitation...
|
command = lib.concatStringsSep " " [
|
||||||
ExecStart = lib.concatStringsSep " " [
|
"env"
|
||||||
"env"
|
"XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal"
|
||||||
"XDG_DESKTOP_PORTAL_DIR=$HOME/.config/xdg-desktop-portal"
|
# "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"
|
];
|
||||||
];
|
serviceConfig.BusName = "org.freedesktop.portal.Desktop";
|
||||||
BusName = "org.freedesktop.portal.Desktop";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xdg-permission-store = {
|
services.xdg-permission-store = {
|
||||||
@@ -82,14 +80,12 @@ in
|
|||||||
before = [ "xdg-desktop-portal.service" ];
|
before = [ "xdg-desktop-portal.service" ];
|
||||||
wantedBy = [ "xdg-desktop-portal.service" ];
|
wantedBy = [ "xdg-desktop-portal.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
command = lib.concatStringsSep " " [
|
||||||
ExecStart = lib.concatStringsSep " " [
|
"env"
|
||||||
"env"
|
"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"
|
];
|
||||||
];
|
serviceConfig.BusName = "org.freedesktop.impl.portal.PermissionStore";
|
||||||
BusName = "org.freedesktop.impl.portal.PermissionStore";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
# also available: ${cfg.package}/libexec/xdg-document-portal
|
# also available: ${cfg.package}/libexec/xdg-document-portal
|
||||||
# - <https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Documents.html>
|
# - <https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Documents.html>
|
||||||
|
@@ -38,17 +38,30 @@ let
|
|||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig.ExecStart = mkOption {
|
command = 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;
|
||||||
|
description = ''
|
||||||
|
long-running command which represents this service.
|
||||||
|
when the command returns, the service is considered "failed", and restarted unless explicitly `down`d.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
serviceConfig.ExecStartPost = mkOption {
|
cleanupCommand = mkOption {
|
||||||
type = types.nullOr (types.coercedTo types.package toString types.str);
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
serviceConfig.ExecStopPost = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
|
description = ''
|
||||||
|
command which is run after the service has exited.
|
||||||
|
restart of the service (if applicable) is blocked on this command.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
pollReadyCommand = mkOption {
|
||||||
|
type = types.nullOr (types.coercedTo types.package toString types.str);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
path to executable which exits zero only when the service is ready.
|
||||||
|
this may be invoked repeatedly (with delay),
|
||||||
|
though it's not an error for it to block either (it may, though, be killed and restarted if it blocks too long)
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
serviceConfig.BusName = mkOption {
|
serviceConfig.BusName = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
|
@@ -153,8 +153,8 @@ let
|
|||||||
s6SvcsFromConfigServices = services: lib.mapAttrsToList
|
s6SvcsFromConfigServices = services: lib.mapAttrsToList
|
||||||
(name: service: {
|
(name: service: {
|
||||||
inherit name;
|
inherit name;
|
||||||
run = service.serviceConfig.ExecStart;
|
run = service.command;
|
||||||
finish = service.serviceConfig.ExecStopPost;
|
finish = service.cleanupCommand;
|
||||||
depends = service.wants ++ builtins.attrNames (
|
depends = service.wants ++ builtins.attrNames (
|
||||||
lib.filterAttrs (_: cfg: lib.elem name cfg.wantedBy || lib.elem "${name}.service" cfg.wantedBy) services
|
lib.filterAttrs (_: cfg: lib.elem name cfg.wantedBy || lib.elem "${name}.service" cfg.wantedBy) services
|
||||||
);
|
);
|
||||||
@@ -167,14 +167,14 @@ let
|
|||||||
# map them onto s6 "bundles". their contents are determined via reverse dependency mapping (`wantedBy` of every other service).
|
# map them onto s6 "bundles". their contents are determined via reverse dependency mapping (`wantedBy` of every other service).
|
||||||
implicitServices = {
|
implicitServices = {
|
||||||
"default.target" = {
|
"default.target" = {
|
||||||
serviceConfig.ExecStart = null;
|
command = null;
|
||||||
serviceConfig.ExecStopPost = null;
|
cleanupCommand = null;
|
||||||
wants = [];
|
wants = [];
|
||||||
wantedBy = [];
|
wantedBy = [];
|
||||||
};
|
};
|
||||||
"graphical-session.target" = {
|
"graphical-session.target" = {
|
||||||
serviceConfig.ExecStart = null;
|
command = null;
|
||||||
serviceConfig.ExecStopPost = null;
|
cleanupCommand = null;
|
||||||
wants = [];
|
wants = [];
|
||||||
wantedBy = [];
|
wantedBy = [];
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user