2024-12-12 10:17:26 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
|
|
{
|
|
|
|
sources ? import ./npins,
|
|
|
|
pkgs ? import sources.nixpkgs { },
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs) lib mkShell;
|
|
|
|
|
|
|
|
hook = lib.recursiveUpdate {
|
|
|
|
name = "reuse lint";
|
|
|
|
entry = "${pkgs.reuse}/bin/reuse lint";
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
install = config: {
|
|
|
|
shellHook =
|
|
|
|
(lib.evalModules {
|
|
|
|
modules = [
|
|
|
|
./modules
|
|
|
|
{ inherit config; }
|
|
|
|
{
|
|
|
|
config._module.args = {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}).config.installationScript;
|
|
|
|
};
|
|
|
|
|
|
|
|
git-checks = (import sources.git-hooks).run {
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
hooks = {
|
|
|
|
statix = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
settings.ignore = [ "npins" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
deadnix = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixfmt-rfc-style = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
reuse = hook {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
commitizen.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
reuse = install {
|
|
|
|
defaultLicense = "EUPL-1.2";
|
|
|
|
defaultCopyright = "2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>";
|
|
|
|
|
2024-12-12 10:45:46 +01:00
|
|
|
downloadLicenses = true;
|
|
|
|
|
2024-12-12 10:54:12 +01:00
|
|
|
generatedPaths = [
|
|
|
|
".envrc"
|
|
|
|
".gitignore"
|
|
|
|
"REUSE.toml"
|
|
|
|
];
|
|
|
|
|
2024-12-12 10:17:26 +01:00
|
|
|
annotations = [
|
|
|
|
{
|
|
|
|
path = "npins/*";
|
|
|
|
license = "EUPL-1.2";
|
|
|
|
copyright = "The [npins](https://github.com/andir/npins) contributors";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
devShell = mkShell {
|
|
|
|
name = "nix-reuse.dev";
|
|
|
|
|
|
|
|
packages = [ pkgs.reuse ];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${git-checks.shellHook}
|
|
|
|
${reuse.shellHook}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit hook install;
|
|
|
|
}
|