fix(nix/fetchGoModule): correctly case-fold mixed-case package paths
Change-Id: I5a93462a23bf3c9f22fc3de0b173763a9bc8d526 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1591 Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu>
This commit is contained in:
parent
c17be2364e
commit
436145a41c
1 changed files with 14 additions and 2 deletions
|
@ -1,10 +1,22 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib)
|
||||
lowerChars
|
||||
replaceStrings
|
||||
upperChars
|
||||
;
|
||||
|
||||
caseFold = replaceStrings upperChars (map (c: "!" + c) lowerChars);
|
||||
|
||||
in
|
||||
|
||||
{ path, version, sha256 }:
|
||||
|
||||
(pkgs.fetchurl {
|
||||
name = "source";
|
||||
url = "https://proxy.golang.org/${path}/@v/v${version}.zip";
|
||||
url = "https://proxy.golang.org/${caseFold path}/@v/v${version}.zip";
|
||||
inherit sha256;
|
||||
|
||||
recursiveHash = true;
|
||||
|
|
Loading…
Reference in a new issue