fetchFromBitBucket: auto-remove an impure file

Also fix the hash in goPackages.inflect, the only user of the fetcher ATM.
Closes #12002 (different `inflect` fix), fixes #12012.
Using fetchzip-derived functions is likely more efficient than fetchhg,
and it's lighter on dependencies (hash is the same as with fetchhg in this case).

+6 -3
+4 -2
pkgs/build-support/fetchzip/default.nix
··· 10 { # Optionally move the contents of the unpacked tree up one level. 11 stripRoot ? true 12 , url 13 , ... } @ args: 14 15 lib.overrideDerivation (fetchurl ({ ··· 47 fi 48 '' else '' 49 mv "$unpackDir"/* "$out/" 50 - ''); 51 - } // removeAttrs args [ "stripRoot" ])) 52 # Hackety-hack: we actually need unzip hooks, too 53 (x: {nativeBuildInputs = x.nativeBuildInputs++ [unzip];})
··· 10 { # Optionally move the contents of the unpacked tree up one level. 11 stripRoot ? true 12 , url 13 + , extraPostFetch ? "" 14 , ... } @ args: 15 16 lib.overrideDerivation (fetchurl ({ ··· 48 fi 49 '' else '' 50 mv "$unpackDir"/* "$out/" 51 + '') #*/ 52 + + extraPostFetch; 53 + } // removeAttrs args [ "stripRoot" "extraPostFetch" ])) 54 # Hackety-hack: we actually need unzip hooks, too 55 (x: {nativeBuildInputs = x.nativeBuildInputs++ [unzip];})
+1
pkgs/top-level/all-packages.nix
··· 372 inherit name sha256; 373 url = "https://bitbucket.org/${owner}/${repo}/get/${rev}.tar.gz"; 374 meta.homepage = "https://bitbucket.org/${owner}/${repo}/"; 375 }; 376 377 # cgit example, snapshot support is optional in cgit
··· 372 inherit name sha256; 373 url = "https://bitbucket.org/${owner}/${repo}/get/${rev}.tar.gz"; 374 meta.homepage = "https://bitbucket.org/${owner}/${repo}/"; 375 + extraPostFetch = ''rm -f "$out"/.hg_archival.txt''; # impure file; see #12002 376 }; 377 378 # cgit example, snapshot support is optional in cgit
+1 -1
pkgs/top-level/go-packages.nix
··· 1751 rev = "8961c3750a47b8c0b3e118d52513b97adf85a7e8"; 1752 owner = "pkg"; 1753 repo = "inflect"; 1754 - sha256 = "04iln5b9iyvr6bcn5cj2zq6vqk3a2b4vsy48y2kylhk7qnakip99"; 1755 }; 1756 }; 1757
··· 1751 rev = "8961c3750a47b8c0b3e118d52513b97adf85a7e8"; 1752 owner = "pkg"; 1753 repo = "inflect"; 1754 + sha256 = "11qdyr5gdszy24ai1bh7sf0cgrb4q7g7fsd11kbpgj5hjiigxb9a"; 1755 }; 1756 }; 1757