nixpkgs/pkgs/by-name/ad/addlicense/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

39 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, fetchpatch
}:
buildGoModule rec {
pname = "addlicense";
version = "1.1.1";
src = fetchFromGitHub {
owner = "google";
repo = "addlicense";
rev = "v${version}";
sha256 = "sha256-YMMHj6wctKtJi/rrcMIrLmNw/uvO6wCwokgYRQxcsFw=";
};
patches = [
# Add support for Nix files. Upstream is slow with responding to PRs,
# patch backported from PR https://github.com/google/addlicense/pull/153.
(fetchpatch {
url = "https://github.com/google/addlicense/commit/e0fb3f44cc7670dcc5cbcec2211c9ad238c5f9f1.patch";
hash = "sha256-XCAvL+HEa1hGc0GAnl+oYHKzBJ3I5ArS86vgABrP/Js=";
})
];
vendorHash = "sha256-2mncc21ecpv17Xp8PA9GIodoaCxNBacbbya/shU8T9Y=";
subPackages = [ "." ];
meta = with lib; {
description = "Ensures source code files have copyright license headers by scanning directory patterns recursively";
homepage = "https://github.com/google/addlicense";
license = licenses.asl20;
maintainers = with maintainers; [ SuperSandro2000 ];
mainProgram = "addlicense";
};
}