Fix fswatch trigger event for services in systemctl. Add guards to subscripts in colorsync service

This commit is contained in:
Martin Larsson 2025-09-07 17:19:22 +02:00
parent a1969ce04e
commit e20321245c
2 changed files with 11 additions and 9 deletions

View file

@ -61,19 +61,16 @@ rec {
description ? "Register ${name}.",
}:
let
fswatchLatencyArg = if isDarwin then "--latency=0.2" else "";
scriptPkg = pkgs.writeShellScriptBin "${name}" ''
set -euo pipefail
ROOT="${root}"
SCRIPT="${scriptPath}"
FSWATCH="${pkgs.fswatch}/bin/fswatch"
FSWATCH_LATENCY_ARG="${fswatchLatencyArg}"
echo root:"$ROOT"
echo script:"$SCRIPT"
echo fswatch:"$FSWATCH"
echo home:"$HOME"
"$FSWATCH" --latency=0.2 -o "$ROOT" | xargs -n1 "$SCRIPT"
"$FSWATCH" $FSWATCH_LATENCY_ARG --event=Updated --event=Created --event=Removed --event=Renamed -o --exclude '\.DS_Store$' "$ROOT" | xargs -n1 "$SCRIPT"
'';
baseBinPath = lib.makeBinPath [