diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..842fe7c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - repo: local + hooks: + - id: treefmt + name: treefmt + pass_filenames: false + entry: treefmt + language: system diff --git a/flake.nix b/flake.nix index a7edbd7..613c607 100644 --- a/flake.nix +++ b/flake.nix @@ -248,7 +248,6 @@ f pkgs ); treefmtEval = forEachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix); - # treefmtWrapper = pkgs: treefmtEval.${pkgs.system}.config.build.wrapper; in { packages = { @@ -258,8 +257,6 @@ # dev shells in project devShells = import ./shell.nix { inherit nixpkgs treefmtEval system; }; - - # formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper); } ); } diff --git a/justfile b/justfile new file mode 100644 index 0000000..6e60ba3 --- /dev/null +++ b/justfile @@ -0,0 +1,6 @@ + +hook-install: + pre-commit install --install-hooks + +fmt: + treefmt diff --git a/shell.nix b/shell.nix index fe430d9..85bac3d 100644 --- a/shell.nix +++ b/shell.nix @@ -7,9 +7,9 @@ let pkgs = nixpkgs.legacyPackages.${system}; packages = with pkgs; [ - podman - direnv git + pre-commit + just ]; in {