programs: use extended ${var} variable expansion in command expressions to satisfy systemd

This commit is contained in:
2024-09-28 21:52:23 +00:00
parent 22f67ac624
commit 823d607867
5 changed files with 16 additions and 16 deletions

View File

@@ -126,12 +126,12 @@ in
# TODO: don't create the sway directory here! # TODO: don't create the sway directory here!
# i do it for now because sway and bonsai call into eachother; circular dependency: # i do it for now because sway and bonsai call into eachother; circular dependency:
# - sway -> bonsai -> sane-input-handler -> swaymsg # - sway -> bonsai -> sane-input-handler -> swaymsg
mkdir -p $XDG_RUNTIME_DIR/{bonsai,sway} mkdir -p ''${XDG_RUNTIME_DIR}/{bonsai,sway}
exec nice -n -11 bonsaid -t $HOME/.config/bonsai/bonsai_tree.json exec nice -n -11 bonsaid -t ''${HOME}/.config/bonsai/bonsai_tree.json
''; '';
cleanupCommand = "rm -f $XDG_RUNTIME_DIR/bonsai/bonsai"; cleanupCommand = ''rm -f ''${XDG_RUNTIME_DIR}/bonsai/bonsai'';
readiness.waitExists = [ readiness.waitExists = [
"$XDG_RUNTIME_DIR/bonsai/bonsai" ''''${XDG_RUNTIME_DIR}/bonsai/bonsai''
]; ];
}; };
}; };

View File

@@ -101,7 +101,7 @@ in
"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"
]); ]);

View File

@@ -155,29 +155,29 @@ in
# 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 = pkgs.writeShellScript "pipewire-start" '' command = pkgs.writeShellScript "pipewire-start" ''
mkdir -p $PIPEWIRE_RUNTIME_DIR mkdir -p ''${PIPEWIRE_RUNTIME_DIR}
# nice -n -21 comes from pipewire defaults (niceness: -11) # nice -n -21 comes from pipewire defaults (niceness: -11)
PIPEWIRE_DEBUG=3 exec nice -n -21 pipewire PIPEWIRE_DEBUG=3 exec nice -n -21 pipewire
''; '';
readiness.waitExists = [ readiness.waitExists = [
"$PIPEWIRE_RUNTIME_DIR/pipewire-0" ''''${PIPEWIRE_RUNTIME_DIR}/pipewire-0''
"$PIPEWIRE_RUNTIME_DIR/pipewire-0-manager" ''''${PIPEWIRE_RUNTIME_DIR}/pipewire-0-manager''
]; ];
cleanupCommand = ''rm -f "$PIPEWIRE_RUNTIME_DIR/{pipewire-0,pipewire-0.lock,pipewire-0-manager,pipewire-0-manager.lock}"''; cleanupCommand = ''rm -f "''${PIPEWIRE_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";
depends = [ "pipewire" ]; depends = [ "pipewire" ];
partOf = [ "sound" ]; partOf = [ "sound" ];
command = pkgs.writeShellScript "pipewire-pulse-start" '' command = pkgs.writeShellScript "pipewire-pulse-start" ''
mkdir -p $XDG_RUNTIME_DIR/pulse mkdir -p ''${XDG_RUNTIME_DIR}/pulse
exec nice -n -21 pipewire-pulse exec nice -n -21 pipewire-pulse
''; '';
readiness.waitExists = [ readiness.waitExists = [
"$XDG_RUNTIME_DIR/pulse/native" ''''${XDG_RUNTIME_DIR}/pulse/native''
"$XDG_RUNTIME_DIR/pulse/pid" ''''${XDG_RUNTIME_DIR}/pulse/pid''
]; ];
cleanupCommand = ''rm -f "$XDG_RUNTIME_DIR/pulse/{native,pid}"''; cleanupCommand = ''rm -f "''${XDG_RUNTIME_DIR}/pulse/{native,pid}"'';
}; };
# bring up sound by default # bring up sound by default

View File

@@ -30,7 +30,7 @@ in
services.schlock = { services.schlock = {
description = "schlock mobile-friendly screen locker"; description = "schlock mobile-friendly screen locker";
command = ''schlock -p "$HOME/.config/schlock/schlock.pin"''; command = ''schlock -p "''${HOME}/.config/schlock/schlock.pin"'';
restartCondition = "on-failure"; restartCondition = "on-failure";
}; };
}; };

View File

@@ -68,7 +68,7 @@ in
# arguable if that's a packaging bug, or limitation... # arguable if that's a packaging bug, or limitation...
command = lib.concatStringsSep " " [ command = 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=xdg-desktop-portal=all" "G_MESSAGES_DEBUG=xdg-desktop-portal=all"
"${cfg.package}/libexec/xdg-desktop-portal" "${cfg.package}/libexec/xdg-desktop-portal"
]; ];
@@ -84,7 +84,7 @@ in
command = lib.concatStringsSep " " [ command = 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"
]; ];
readiness.waitDbus = "org.freedesktop.impl.portal.PermissionStore"; readiness.waitDbus = "org.freedesktop.impl.portal.PermissionStore";