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

Merge pull request #863 from nrabulinski/no-yabai-ifd

services/yabai: Remove IFD
This commit is contained in:
Michael Hoang 2024-02-02 10:26:16 +10:00 committed by GitHub
commit bdbae6ecff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
'';
})
];
}