diff --git a/modules/hooks.nix b/modules/hooks.nix index 5590f3ab..d345568d 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -1294,6 +1294,20 @@ in }; }; }; + reuse = mkOption { + description = lib.mdDoc "reuse hook"; + type = types.submodule { + imports = [ hookModule ]; + options.settings = { + flags = mkOption { + type = types.str; + description = lib.mdDoc "Flags passed to reuse. For available options run 'reuse lint --help'"; + default = ""; + example = "--json"; + }; + }; + }; + }; revive = mkOption { description = lib.mdDoc "revive hook"; type = types.submodule { @@ -3088,6 +3102,15 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol entry = migrateBinPathToPackage hooks.pyupgrade "/bin/pyupgrade"; types = [ "python" ]; }; + reuse = + { + name = "reuse"; + description = "reuse is a tool for compliance with the REUSE recommendations."; + package = tools.reuse; + entry = "${hooks.reuse.package}/bin/reuse lint ${hooks.reuse.settings.flags}"; + types = [ "file" ]; + pass_filenames = false; + }; revive = { name = "revive"; diff --git a/nix/tools.nix b/nix/tools.nix index d3a195ce..49fdba3d 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -56,6 +56,7 @@ , pyright ? nodePackages.pyright , php82Packages , ripsecrets ? null +, reuse , ruff ? null , rustfmt , shellcheck @@ -133,6 +134,7 @@ in pre-commit-hook-ensure-sops poetry pyright + reuse revive ripsecrets ruff