feat(checks): Fully rework lints
This is currently copied from my dotfiles. Should probably consider using flake-parts to DRY this out.
This commit is contained in:
parent
a90ba627bd
commit
79eb8f9424
4 changed files with 221 additions and 820 deletions
35
checks/lib.nix
Normal file
35
checks/lib.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue