mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
build-support/fetchgithub: fix metadata eval for arguments without locations
Without the change metadata evaluation fails on package like `zammad.src` where no fields are defined in `.nix `files: src = fetchFromGitHub (lib.importJSON ./source.json); There evaluation fails as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' error: 23| # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation 24| position = "${position.file}:${toString position.line}"; | ^ 25| }; error: value is null while a set was expected After the change evaluation succeeds as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' { homepage = "https://github.com/zammad/zammad"; }
This commit is contained in:
parent
55b9aa64c3
commit
6104083817
@ -19,7 +19,7 @@ let
|
||||
baseUrl = "https://${githubBase}/${owner}/${repo}";
|
||||
newMeta = meta // {
|
||||
homepage = meta.homepage or baseUrl;
|
||||
|
||||
} // lib.optionalAttrs (position != null) {
|
||||
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
|
||||
position = "${position.file}:${toString position.line}";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user