Skip to content

Commit 8516529

Browse files
getchooScrumplex
authored andcommitted
ci: add flake checks
1 parent 4e342aa commit 8516529

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

flake.nix

+23
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,29 @@
2121
nixpkgsFor = nixpkgs.legacyPackages;
2222
in
2323
{
24+
checks = forAllSystems (
25+
system:
26+
let
27+
pkgs = nixpkgsFor.${system};
28+
mkCheck =
29+
name: deps: script:
30+
pkgs.runCommand name { nativeBuildInputs = deps; } ''
31+
${script}
32+
touch $out
33+
'';
34+
in
35+
{
36+
actionlint = mkCheck "check-actionlint" [ pkgs.actionlint ] "actionlint ${./.github/workflows}/*";
37+
deadnix = mkCheck "check-deadnix" [ pkgs.deadnix ] "deadnix --fail ${self}";
38+
statix = mkCheck "check-statix" [ pkgs.statix ] "statix check ${self}";
39+
nixfmt = mkCheck "check-nixfmt" [ pkgs.nixfmt-rfc-style ] "nixfmt --check ${self}";
40+
rustfmt = mkCheck "check-rustfmt" [
41+
pkgs.cargo
42+
pkgs.rustfmt
43+
] "cd ${self} && cargo fmt -- --check";
44+
}
45+
);
46+
2447
devShells = forAllSystems (
2548
system:
2649
let

0 commit comments

Comments
 (0)