Created
April 23, 2023 16:17
-
-
Save voidus/9caf14a8efac08918f9fe889fe5628ac to your computer and use it in GitHub Desktop.
patching go dependencies in nix is hard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(final: prev: { | |
gh = prev.gh.overrideDerivation (old: { | |
buildPhase = | |
let | |
patch = | |
(final.fetchpatch2 { | |
url = "https://github.com/zalando/go-keyring/commit/4e8623abca7e227443bc7e95dd1c0bdfc1490545.patch"; | |
sha256 = "sha256-TWaLoA9BpEzXYdguXjMxuQB9e3+QMKMTkxhJTSQeWJs="; | |
extraPrefix = "vendor/github.com/zalando/go-keyring/"; | |
stripLen = 1; | |
}); | |
in | |
'' | |
( | |
set -x | |
mv vendor vendor_ | |
cp -rL vendor_ vendor | |
chmod -R u+w vendor | |
patch -p1 < ${patch} | |
) | |
${old.buildPhase} | |
''; | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment