Skip to content

Instantly share code, notes, and snippets.

@voidus
Created April 23, 2023 16:17
Show Gist options
  • Save voidus/9caf14a8efac08918f9fe889fe5628ac to your computer and use it in GitHub Desktop.
Save voidus/9caf14a8efac08918f9fe889fe5628ac to your computer and use it in GitHub Desktop.
patching go dependencies in nix is hard
(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