Tom Hubrecht
139caccebb
When set to true, entering the shell will download all missing licenses from the project
101 lines
1.8 KiB
Nix
101 lines
1.8 KiB
Nix
# 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>";
|
|
|
|
downloadLicenses = true;
|
|
|
|
annotations = [
|
|
# Basic paths
|
|
{
|
|
path = [
|
|
".envrc"
|
|
".gitignore"
|
|
"REUSE.toml"
|
|
];
|
|
}
|
|
{
|
|
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;
|
|
}
|