Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/nix-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ jobs:
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
- name: Lint Nix files
run: |
nix-shell -I nixpkgs=./tools/nix/pkgs.nix -p 'nixfmt-tree' --run '
treefmt --quiet --ci
' && EXIT_CODE="$?" || EXIT_CODE="$?"
NIX_LINTER=$(nix-instantiate --eval --raw -E '(import ./shell.nix {}).NIX_LINTER')
# Attempt to get it from cache, and fallback to building `devTools.nix` otherwise.
nix-store --realise "${NIX_LINTER%/bin/*}" || nix-build -I nixpkgs=tools/nix/pkgs.nix ./tools/nix/devTools.nix --no-out-link
"$NIX_LINTER" --quiet --ci && EXIT_CODE="$?" || EXIT_CODE="$?"
if [ "$EXIT_CODE" != "0" ]
then
git --no-pager diff || true
Expand Down
8 changes: 8 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ pkgs.mkShell {
YAMLLINT = pkgs.lib.getExe yamllint;
}
)
// (
let
treefmt = pkgs.lib.lists.findFirst (p: p.meta.mainProgram == "treefmt") null devTools;
in
pkgs.lib.optionalAttrs (treefmt != null) {
NIX_LINTER = pkgs.lib.getExe treefmt;
}
)
// pkgs.lib.optionalAttrs (!withSQLite) {
NOSQLITE = "1";
}
Expand Down
1 change: 1 addition & 0 deletions tools/nix/devTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
pkgs.gh
pkgs.git
pkgs.jq
pkgs.nixfmt-tree
pkgs.ruff
pkgs.shellcheck
pkgs.yamllint
Expand Down
2 changes: 1 addition & 1 deletion tools/nix/list-requisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DRV=$(
++ builtins.attrValues (
{
# Additional packages we are using across the codebase
inherit (pkgs) nixfmt-tree sccache;
inherit (pkgs) sccache;
}
// import ./tools/nix/openssl-matrix.nix { }
// sharedLibDepsFn (
Expand Down