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:
parent
91b9daf672
commit
4363d3b42f
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue