Skip to content

Commit e117efa

Browse files
committed
ci: ensure flake is formatted
1 parent 7b98274 commit e117efa

File tree

2 files changed

+45
-21
lines changed

2 files changed

+45
-21
lines changed

.github/workflows/nix.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test Nix flake
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
format:
11+
name: check flake formatting
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
show-progress: false
17+
- uses: DeterminateSystems/nix-installer-action@main
18+
- uses: DeterminateSystems/magic-nix-cache-action@main
19+
- run: nix fmt
20+
21+
# Check that formatting does not change anything.
22+
- run: git diff --exit-code

flake.nix

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -533,28 +533,30 @@
533533
};
534534
};
535535

536-
devShells.default = let
537-
pkgs = import nixpkgs {
538-
system = system;
539-
overlays = [ fenix.overlays.default ];
540-
};
541-
in pkgs.mkShell {
536+
devShells.default =
537+
let
538+
pkgs = import nixpkgs {
539+
system = system;
540+
overlays = [ fenix.overlays.default ];
541+
};
542+
in
543+
pkgs.mkShell {
542544

543-
buildInputs = with pkgs; [
544-
(fenix.packages.${system}.complete.withComponents [
545-
"cargo"
546-
"clippy"
547-
"rust-src"
548-
"rustc"
549-
"rustfmt"
550-
])
551-
cargo-deny
552-
rust-analyzer-nightly
553-
cargo-nextest
554-
perl # needed to build vendored OpenSSL
555-
git-cliff
556-
];
557-
};
545+
buildInputs = with pkgs; [
546+
(fenix.packages.${system}.complete.withComponents [
547+
"cargo"
548+
"clippy"
549+
"rust-src"
550+
"rustc"
551+
"rustfmt"
552+
])
553+
cargo-deny
554+
rust-analyzer-nightly
555+
cargo-nextest
556+
perl # needed to build vendored OpenSSL
557+
git-cliff
558+
];
559+
};
558560
}
559561
);
560562
}

0 commit comments

Comments
 (0)