mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Add flake checks
This commit is contained in:
parent
2938191083
commit
584cd2101a
5 changed files with 40 additions and 9 deletions
|
|
@ -62,6 +62,7 @@
|
||||||
./flake/wrappers.nix
|
./flake/wrappers.nix
|
||||||
./flake/dev-shells.nix
|
./flake/dev-shells.nix
|
||||||
./flake/formatter.nix
|
./flake/formatter.nix
|
||||||
|
./flake/checks.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
flake/checks.nix
Normal file
26
flake/checks.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ self, inputs, ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
checks = {
|
||||||
|
treefmt = (import ./treefmt.nix { inherit inputs pkgs; }).check self;
|
||||||
|
|
||||||
|
statix =
|
||||||
|
let
|
||||||
|
statix-config = pkgs.writeText "statix.toml" ''
|
||||||
|
disabled = ["repeated_keys"]
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
pkgs.runCommand "statix" { buildInputs = [ pkgs.statix ]; } ''
|
||||||
|
statix check ${self} --config ${statix-config}
|
||||||
|
mkdir $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
deadnix = pkgs.runCommand "deadnix" { buildInputs = [ pkgs.deadnix ]; } ''
|
||||||
|
deadnix ${self} --fail --exclude ${self}/flake/formatter.nix
|
||||||
|
mkdir $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,14 +3,6 @@
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
formatter =
|
formatter = (import ./treefmt.nix { inherit inputs pkgs; }).wrapper;
|
||||||
(inputs.treefmt-nix.lib.evalModule pkgs {
|
|
||||||
projectRootFile = "flake.nix";
|
|
||||||
programs = {
|
|
||||||
nixfmt.enable = true;
|
|
||||||
prettier.enable = true;
|
|
||||||
just.enable = true;
|
|
||||||
};
|
|
||||||
}).config.build.wrapper;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
flake/treefmt.nix
Normal file
9
flake/treefmt.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{ inputs, pkgs, ... }:
|
||||||
|
(inputs.treefmt-nix.lib.evalModule pkgs {
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
programs = {
|
||||||
|
nixfmt.enable = true;
|
||||||
|
prettier.enable = true;
|
||||||
|
just.enable = true;
|
||||||
|
};
|
||||||
|
}).config.build
|
||||||
3
justfile
3
justfile
|
|
@ -22,3 +22,6 @@ update:
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
nix fmt
|
nix fmt
|
||||||
|
|
||||||
|
check:
|
||||||
|
nix flake check
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue