ci: ensure flake is formatted

This commit is contained in:
link2xt
2024-11-14 16:22:13 +00:00
committed by l
parent 7b98274681
commit e117efa744
2 changed files with 45 additions and 21 deletions

22
.github/workflows/nix.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Test Nix flake
on:
pull_request:
push:
branches:
- main
jobs:
format:
name: check flake formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix fmt
# Check that formatting does not change anything.
- run: git diff --exit-code

View File

@@ -533,28 +533,30 @@
}; };
}; };
devShells.default = let devShells.default =
pkgs = import nixpkgs { let
system = system; pkgs = import nixpkgs {
overlays = [ fenix.overlays.default ]; system = system;
}; overlays = [ fenix.overlays.default ];
in pkgs.mkShell { };
in
pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
(fenix.packages.${system}.complete.withComponents [ (fenix.packages.${system}.complete.withComponents [
"cargo" "cargo"
"clippy" "clippy"
"rust-src" "rust-src"
"rustc" "rustc"
"rustfmt" "rustfmt"
]) ])
cargo-deny cargo-deny
rust-analyzer-nightly rust-analyzer-nightly
cargo-nextest cargo-nextest
perl # needed to build vendored OpenSSL perl # needed to build vendored OpenSSL
git-cliff git-cliff
]; ];
}; };
} }
); );
} }