Compare commits
1 commit
e75c7b831b
...
10e72d3c19
| Author | SHA1 | Date | |
|---|---|---|---|
| 10e72d3c19 |
1 changed files with 65 additions and 66 deletions
|
|
@ -7,77 +7,76 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
checks =
|
||||
let
|
||||
mkLint =
|
||||
{
|
||||
name,
|
||||
fileset,
|
||||
checkInputs ? [ ],
|
||||
script,
|
||||
}:
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
inherit name;
|
||||
|
||||
src = lib.fileset.toSource {
|
||||
root = ../.;
|
||||
fileset = lib.fileset.difference fileset (
|
||||
lib.fileset.fileFilter (
|
||||
file: file.type != "regular" || file.name == "hardware-configuration.nix"
|
||||
) ../.
|
||||
);
|
||||
};
|
||||
|
||||
checkInputs = [ pkgs.nushell ] ++ checkInputs;
|
||||
|
||||
checkPhase = ''
|
||||
nu -c '${script}' | tee $out
|
||||
'';
|
||||
|
||||
dontPatch = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontInstall = true;
|
||||
dontFixup = true;
|
||||
doCheck = true;
|
||||
};
|
||||
in
|
||||
let
|
||||
mkLint =
|
||||
{
|
||||
nix = mkLint {
|
||||
name = "nix-lints";
|
||||
fileset = lib.fileset.fileFilter (file: file.hasExt "nix") ../.;
|
||||
name,
|
||||
fileset,
|
||||
checkInputs ? [ ],
|
||||
script,
|
||||
}:
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
inherit name;
|
||||
|
||||
checkInputs = lib.attrValues {
|
||||
inherit (pkgs) deadnix nixfmt-rfc-style;
|
||||
|
||||
statix = pkgs.statix.overrideAttrs (old: {
|
||||
patches = old.patches ++ [
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/oppiliappan/statix/commit/925dec39bb705acbbe77178b4d658fe1b752abbb.patch";
|
||||
hash = "sha256-0wacO6wuYJ4ufN9PGucRVJucFdFFNF+NoHYIrLXsCWs=";
|
||||
})
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
script = /* bash */ ''
|
||||
statix check **/*.nix
|
||||
deadnix --fail **/*.nix
|
||||
nixfmt --check --strict **/*.nix
|
||||
'';
|
||||
src = lib.fileset.toSource {
|
||||
root = ../.;
|
||||
fileset = lib.fileset.difference fileset (
|
||||
lib.fileset.fileFilter (
|
||||
file: file.type != "regular" || file.name == "hardware-configuration.nix"
|
||||
) ../.
|
||||
);
|
||||
};
|
||||
|
||||
lockfile = mkLint {
|
||||
name = "nix-lockfile";
|
||||
fileset = ../flake.lock;
|
||||
checkInputs = lib.attrValues { inherit (inputs'.flint.packages) flint; };
|
||||
checkInputs = [ pkgs.nushell ] ++ checkInputs;
|
||||
|
||||
script = /* bash */ ''
|
||||
flint --fail-if-multiple-versions
|
||||
'';
|
||||
checkPhase = ''
|
||||
nu -c '${script}' | tee $out
|
||||
'';
|
||||
|
||||
dontPatch = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontInstall = true;
|
||||
dontFixup = true;
|
||||
doCheck = true;
|
||||
};
|
||||
in
|
||||
{
|
||||
checks = {
|
||||
nix = mkLint {
|
||||
name = "nix-lints";
|
||||
fileset = lib.fileset.fileFilter (file: file.hasExt "nix") ../.;
|
||||
|
||||
checkInputs = lib.attrValues {
|
||||
inherit (pkgs) deadnix nixfmt-rfc-style;
|
||||
|
||||
statix = pkgs.statix.overrideAttrs (old: {
|
||||
patches = old.patches ++ [
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/oppiliappan/statix/commit/925dec39bb705acbbe77178b4d658fe1b752abbb.patch";
|
||||
hash = "sha256-0wacO6wuYJ4ufN9PGucRVJucFdFFNF+NoHYIrLXsCWs=";
|
||||
})
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
// self.nixosConfigurations.hetzner-1.config.serviceTests;
|
||||
|
||||
script = /* bash */ ''
|
||||
statix check **/*.nix
|
||||
deadnix --fail **/*.nix
|
||||
nixfmt --check --strict **/*.nix
|
||||
'';
|
||||
};
|
||||
|
||||
lockfile = mkLint {
|
||||
name = "nix-lockfile";
|
||||
fileset = ../flake.lock;
|
||||
checkInputs = lib.attrValues { inherit (inputs'.flint.packages) flint; };
|
||||
|
||||
script = /* bash */ ''
|
||||
flint --fail-if-multiple-versions
|
||||
'';
|
||||
};
|
||||
}
|
||||
// self.nixosConfigurations.hetzner-1.config.serviceTests;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue