diff options
author | Jonathan Ringer <jonringer117@gmail.com> | 2022-02-09 16:53:15 -0800 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2022-02-10 10:18:16 -0800 |
commit | 560bf3f7604a129d4c0dbd9abaade2c855340983 (patch) | |
tree | 5447854c7a0159187d6511f31af3cdc2b86198ca | |
parent | 665684a981edbdc1de4f374363b2c3923249caa6 (diff) | |
download | nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar.gz nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar.bz2 nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar.lz nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar.xz nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.tar.zst nixpkgs-560bf3f7604a129d4c0dbd9abaade2c855340983.zip |
fetchFromGitHub: perserve originating position
-rw-r--r-- | pkgs/build-support/fetchgithub/default.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index d03d344dbb2..27cb8312ea0 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -10,8 +10,18 @@ }@args: let + + position = (if args.meta.description or null != null + then builtins.unsafeGetAttrPos "description" args.meta + else builtins.unsafeGetAttrPos "rev" args + ); baseUrl = "https://${githubBase}/${owner}/${repo}"; - newMeta = meta // { homepage = meta.homepage or baseUrl; }; + newMeta = meta // { + homepage = meta.homepage or baseUrl; + + # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation + position = "${position.file}:${toString position.line}"; + }; passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ]; varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_"; useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != ""); |