rix101/modules/nix-darwin/yabai/setbg/default.nix
reo101 36e14ad3f6
style: format with nix fmt
Currently uses `nixpkgs-fmt`
2024-01-25 17:39:43 +02:00

27 lines
504 B
Nix

{ lib
, writeShellScriptBin
, symlinkJoin
, makeWrapper
, jq
, yabai
}:
let
# NOTE: passing `${1}` because `${0}` resolves to the `.setbg-wrapped` path
setWallpaperUnwrapped =
writeShellScriptBin "setbg" ''
osascript ${./setbg.scpt} "''${1}"
'';
in
symlinkJoin {
name = "setbg";
paths = [ setWallpaperUnwrapped ];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/setbg \
--prefix PATH : ${lib.makeBinPath [
jq
yabai
]}
'';
}