This is currently copied from my dotfiles. Should probably consider using flake-parts to DRY this out.
35 lines
715 B
Nix
35 lines
715 B
Nix
{ 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;
|
|
};
|
|
}
|