Declarative configuration of REUSE in your Nix shells
				
			
		| LICENSES | ||
| module | ||
| shell | ||
| .envrc | ||
| .gitignore | ||
| default.nix | ||
| lon.lock | ||
| lon.nix | ||
| README.md | ||
| REUSE.toml | ||
Integration of reuse with Nix
Features
- Provides a shell hook to generate the REUSE.tomlfile
- Provides a hook to be used with git-hooks.nix
Getting started
REUSE.toml generation
npins
- Add nix-reuseto your sources:
npins add git https://git.dgnum.eu/DGNum/nix-reuse
- Integrate workflows to shell.nix:
let
    sources = import ./npins;
    reuse = (import sources.nix-reuse { }).install {
        defaultLicense = "EUPL-1.2";
        defaultCopyright = "Jane Doe <jane.doe@example.com>";
        generatedPaths = [
            ".envrc"
            ".gitignore"
            "REUSE.toml"
        ];
        annotations = [
            { path = "default.nix"; }
            {
                path = "npins/*";
                license = "EUPL-1.2";
                copyright = "The [npins](https://github.com/andir/npins) contributors";
            }
        ];
    };
in
with (import sources.nixpkgs { });
mkShell {
    packages = [ ... ];
    inherit (reuse) shellHook;
}
Options
- defaultLicense: the default license SPDX identifier used accross the project.
- defaultCopyright: the default copyright text used accross the project.
- downloadLicenses: whether to download automatically the missing licenses detectd in the project.
- generatedPaths: a list of computer-generated files, they will be declared with a copyright of- NONEand the- CC0-1.0license.
- annotations: the list of annotations for this project.
reuse git-hook
npins
- Add nix-reuseto your sources:
npins add git https://git.dgnum.eu/DGNum/nix-reuse
- Integrate reuse to git hooks:
let
    sources = import ./npins;
    git-checks = (import sources."git-hooks.nix").run {
        src = ./.;
        hooks = {
            reuse = (import sources.nix-reuse { }).hook {
                enable = true;
            };
        };
    };
in
with (import sources.nixpkgs { });
mkShell {
    packages = [ ... ];
    inherit (git-checks) shellHook;
}