You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After researching a bit, i discovered git-hooks uses git to first figure out the root of the project, check for an existing .pre-commit-config.yaml, if there is one it and it's not a symlink it will error out else it will create or update the symlink from what i presume is the config file created in the nix store to the config file in the root of your project.
For anyone else who's searching for a solution, This is what I've temporarily done to my devShell:
shellHook='' FLAKE_ROOT=$(${getExegitMinimal} rev-parse --show-toplevel) SYMLINK_SOURCE_PATH="${treefmt.build.configFile}" SYMLINK_TARGET_PATH="$FLAKE_ROOT/.treefmt.toml" if [[ -e "$SYMLINK_TARGET_PATH" && ! -L "$SYMLINK_TARGET_PATH" ]]; then echo "treefmt-nix: Error: Target exists but is not a symlink." exit 1 fi if [[ -L "$SYMLINK_TARGET_PATH" ]]; then if [[ "$(readlink "$SYMLINK_TARGET_PATH")" != "$SYMLINK_SOURCE_PATH" ]]; then echo "treefmt-nix: Removing existing symlink" unlink "$SYMLINK_TARGET_PATH" else exit 0 fi fi nix-store --add-root "$SYMLINK_TARGET_PATH" --indirect --realise "$SYMLINK_SOURCE_PATH" echo "treefmt-nix: Created symlink successfully" '';
I use flake-parts with the treefmt-nix flakeModule. treefmt in this code is just config.treefmt.
Is your feature request related to a problem? Please describe.
treefmt.toml
.treefmt.toml
.Describe the solution you'd like
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: