544cc616d8
Fetch GitHub SPDX license metadata during plugin updates and emit meta.license for generated vim plugin derivations. Fall back to lib.licenses.unfree when no SPDX license is detected, and round-trip existing license metadata through get-plugins.nix so partial updates do not drop it.
34 lines
801 B
Nix
34 lines
801 B
Nix
with import <localpkgs> { };
|
|
let
|
|
inherit (vimUtils.override { inherit vim; }) buildVimPlugin;
|
|
|
|
generated = callPackage <localpkgs/pkgs/applications/editors/vim/plugins/generated.nix> {
|
|
inherit buildVimPlugin;
|
|
} { } { };
|
|
|
|
hasChecksum =
|
|
value:
|
|
lib.isAttrs value
|
|
&& lib.hasAttrByPath [
|
|
"src"
|
|
"outputHash"
|
|
] value;
|
|
|
|
parse = _name: value: {
|
|
inherit (value) pname version;
|
|
homePage = value.meta.homepage;
|
|
license = value.meta.license.spdxId or null;
|
|
checksum =
|
|
if hasChecksum value then
|
|
{
|
|
submodules = value.src.fetchSubmodules or false;
|
|
sha256 = value.src.outputHash;
|
|
inherit (value.src) rev;
|
|
tag = value.src.tag or null;
|
|
}
|
|
else
|
|
null;
|
|
};
|
|
in
|
|
lib.mapAttrs parse generated
|