go-modules: simplify overriding#171586
go-modules: simplify overriding#171586tjni wants to merge 1 commit intoNixOS:masterfrom tjni:build-go-module
Conversation
I'd very strongly prefer that we don't do this, I'd rather keep this as a single file. |
|
I think this will lead to a lot of rebuilds because |
I only have a slight preference to keeping them separate, so I'll change that since you feel strongly about it. |
|
Not sure I understand why only some of these are |
Great question! If an attribute is derived from another attribute (that could come from a Some attributes, like I hope this makes sense! |
|
I'll be more specific, why |
|
The intention behind |
The aim of this patch is to enable overriding attributes of Go modules,
such as src and vendorSha256, like:
myGoModule.overrideAttrs (oldAttrs: {
src = fetchFromGitHub {
...
};
vendorSha256 = "...";
});
which is more idiomatic and what a novice Nix user would expect to work.
|
Maybe I'm just too tired and I'm not seeing it but neither are used in While I realise some people want a way of being able to override this TBH I don't think is a good idea. Rather than introducing more complexity to address the non-default use case maybe we should try to find another approach that would hopefully be simpler even if it is a rewrite of |
No worries. and
I don't mind that but don't have any ideas. The standard way to override a derivation via an overlay is: which breaks completely when |
|
btw |
Don't understand what this means? |
|
Hi! Are you still working on this! The current |
|
This is closed since #225051 containing a similar approach is merged. If you have any optimization on top of it, feel free to reopen and reuse this. |
This is currently a proof of concept, pending a resolution to the discussion in #119942.
Please feel free though to offer feedback or test this out.
I extracted a bunch of logic indefault.nixinto a separatego-modules.nix, hence the number of lines changed.Description of changes
The aim of this patch is to enable overriding attributes of Go modules,
such as src and vendorSha256, like:
which is more idiomatic and what a novice Nix user would expect to work.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes