# SPDX-FileCopyrightText: 2024 Tom Hubrecht # # 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 "; 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; }