File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,9 +111,10 @@ jobs:
111111 - uses : cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
112112 - name : Lint Nix files
113113 run : |
114- nix-shell -I nixpkgs=./tools/nix/pkgs.nix -p 'nixfmt-tree' --run '
115- treefmt --quiet --ci
116- ' && EXIT_CODE="$?" || EXIT_CODE="$?"
114+ NIX_LINTER=$(nix-instantiate --eval --raw -E '(import ./shell.nix {}).NIX_LINTER')
115+ # Attempt to get it from cache, and fallback to building `devTools.nix` otherwise.
116+ nix-store --realise "${NIX_LINTER%/bin/*}" || nix-build -I nixpkgs=tools/nix/pkgs.nix ./tools/nix/devTools.nix --no-out-link
117+ "$NIX_LINTER" --quiet --ci && EXIT_CODE="$?" || EXIT_CODE="$?"
117118 if [ "$EXIT_CODE" != "0" ]
118119 then
119120 git --no-pager diff || true
Original file line number Diff line number Diff line change @@ -167,6 +167,14 @@ pkgs.mkShell {
167167 YAMLLINT = pkgs . lib . getExe yamllint ;
168168 }
169169 )
170+ // (
171+ let
172+ treefmt = pkgs . lib . lists . findFirst ( p : p . meta . mainProgram == "treefmt" ) null devTools ;
173+ in
174+ pkgs . lib . optionalAttrs ( treefmt != null ) {
175+ NIX_LINTER = pkgs . lib . getExe treefmt ;
176+ }
177+ )
170178 // pkgs . lib . optionalAttrs ( ! withSQLite ) {
171179 NOSQLITE = "1" ;
172180 }
Original file line number Diff line number Diff line change 77 pkgs . gh
88 pkgs . git
99 pkgs . jq
10+ pkgs . nixfmt-tree
1011 pkgs . ruff
1112 pkgs . shellcheck
1213 pkgs . yamllint
Original file line number Diff line number Diff line change 5858 ++ builtins.attrValues (
5959 {
6060 # Additional packages we are using across the codebase
61- inherit (pkgs) nixfmt-tree sccache;
61+ inherit (pkgs) sccache;
6262 }
6363 // import ./tools/nix/openssl-matrix.nix { }
6464 // sharedLibDepsFn (
You can’t perform that action at this time.
0 commit comments