Your one-stop-cake-shop for everything Freshly Baked has to offer

fix(npins): fetch dependencies from correct ref

We would previously get this error when fetching on new machines

… while fetching the input 'git+https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch?rev=398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f'

error: Cannot find Git revision '398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f' in ref 'refs/heads/master' of repository 'https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

Now, this is what I'd expect - because we're not meant to be fetching
master of this extension - we're meant to be fetching a branch! This
seems to be an issue with npins' fetchgit call, which misses out the ref

Due to a nilla bug, fetching dependencies is required for evaluation
so this prevented any evaluation

Changed files
+14 -8
packetmix
+10 -4
packetmix/npins/default.nix
··· 85 85 url, 86 86 submodules, 87 87 rev, 88 + branch ? null, 88 89 name, 89 90 narHash, 90 91 }: 91 - pkgs.fetchgit { 92 + pkgs.fetchgit ({ 92 93 inherit url rev name; 93 94 fetchSubmodules = submodules; 94 95 hash = narHash; 95 - }; 96 + } // (if branch == null then {} else { 97 + ref = "refs/heads/${branch}"; 98 + })); 96 99 }; 97 100 98 101 # Dispatch to the correct code path based on the type ··· 124 127 repository, 125 128 revision, 126 129 url ? null, 130 + branch ? null, 127 131 submodules, 128 132 hash, 129 133 ... ··· 159 163 "${if matched == null then "source" else builtins.head matched}${appendShort}"; 160 164 name = urlToName url revision; 161 165 in 162 - fetchGit { 166 + fetchGit ({ 163 167 rev = revision; 164 168 narHash = hash; 165 169 166 170 inherit name submodules url; 167 - }; 171 + } // (if branch == null then {} else { 172 + ref = "refs/heads/${branch}"; 173 + })); 168 174 169 175 mkPyPiSource = 170 176 { fetchurl, ... }:
+4 -4
packetmix/npins/sources.json
··· 22 22 "submodules": false, 23 23 "revision": "12fb5f6d1a4bcfd1741b02fd60ec3c9ff6ec5faa", 24 24 "url": null, 25 - "hash": "sha256-vaSNVdiU9tLA5DujSFKAvY4fUiHVGEMvBzuswyPG22k=" 25 + "hash": "sha256-yks79QtWndY2+ESKFcO2EPlj886TDLV+DldK+GpiMXI=" 26 26 }, 27 27 "AutoCreateCategoryPages": { 28 28 "type": "GitRelease", ··· 520 520 }, 521 521 "branch": "master", 522 522 "submodules": false, 523 - "revision": "f4e3698681704e74196fa0f905c7dfdd43cf5c86", 524 - "url": "https://github.com/andir/npins/archive/f4e3698681704e74196fa0f905c7dfdd43cf5c86.tar.gz", 525 - "hash": "sha256-8lkiistkBemkRN4aTqGW3SvI1CqibOnvFvNJS9OOdnU=" 523 + "revision": "0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e", 524 + "url": "https://github.com/andir/npins/archive/0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e.tar.gz", 525 + "hash": "sha256-9N14/tliOiA49Us2uFUWHcrhYN8AmJjR+bnwzcxejgs=" 526 526 }, 527 527 "scriptfs": { 528 528 "type": "Git",