1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

services/yabai: Remove IFD

enableScriptingAddition no longer triggers IFD
by using runCommand to generate sudoers.d/yabai,
instead of builtins.hashFile and interpolating the string in nix.
This commit is contained in:
Nikodem Rabuliński 2024-02-01 23:00:34 +01:00
parent 91b9daf672
commit 4363d3b42f
No known key found for this signature in database
GPG key ID: FF629AA9E08138DB

View file

@ -96,11 +96,13 @@ in
serviceConfig.KeepAlive.SuccessfulExit = false;
};
environment.etc."sudoers.d/yabai".text =
let
sha = builtins.hashFile "sha256" "${cfg.package}/bin/yabai";
in
"%admin ALL=(root) NOPASSWD: sha256:${sha} ${cfg.package}/bin/yabai --load-sa";
environment.etc."sudoers.d/yabai".source = pkgs.runCommand "sudoers-yabai" {} ''
YABAI_BIN="${cfg.package}/bin/yabai"
SHASUM=$(sha256sum "$YABAI_BIN" | cut -d' ' -f1)
cat <<EOF >"$out"
%admin ALL=(root) NOPASSWD: sha256:$SHASUM $YABAI_BIN --load-sa
EOF
'';
})
];
}