Conversation
easy multi-arch support
nix-prefetch-url, but that directly replaces the sha256 in the file nix edit supports fetchSources TODO: support all the `nix edit` options
|
I like the idea. The script should probably be located in |
|
There is a different package called: |
|
Two questions:
|
|
the updater script is only there to illustrate the possibility for now. It could be cannibalized or moved to a different repo. The important part is to have access to all the fetchurl instances regardless of the tool. I think fetchSources should be tried of a few other things before being merged. I am also not quite sure of the naming yet. |
|
Just for related work, I also post this project here: https://github.com/makefu/nix-src-updater |
Indeed. We should update that one. The main advantage of this script is that it locates the file to edit without the need of a |
|
@layus I tried to mimic the UX of |
Okay, I was already going too far :-). fetchSources is a good name, and I like the concept. Other idea: Why not automatically detect the right source, or provide a fetchSystemSource function ?
May I suggest factorio ? |
|
I think `fetchSources` name is misleading. None of the examples seem to fetch _sources_ but instead fetch something binary.
May I suggest `fetchBinaries` or, even better, `selectArch` instead?
`selectArch` also suggests more generic usage anywhere where nixpkgs dispatches on `stdenv.system`.
The `.sources` thing is nice and also integrates well with a little related experiment we run at SLNOS, which looks like this:
```nix
src = selectSource {
tarball = fetchurl {};
vcs = fetchgit {};
}
```
(You can then specify which source `selectSource` would give by default with `nixpkgs.config`.)
The point of the experiment is to make it possible to (eventually) review _all_ changes to _all_ packages.
(We have a little system where we vote for and/or veto git commits to nixpkgs, this would (eventually) extend it to voting for all changes to the whole system.)
|
|
It looks like fetchSource could just be a lib function since it's not depending on stdenv. How about: |
|
See 37dedf64536f366df730584b5fb285b0469d2bea of #35075.
|
|
If I understand correctly, the point is to add the list of the alternative downloads as an attribute of the chosen one. |
|
That too, but I don't care about that part, I care about the syntax. |
|
Ah, I have a better idea for both here and my PR: I will implement |
|
As long as the original attribute set is still accessible somehow it's fine by me |
Motivation for this change
This is a revival of #19582 but simplified to try to simplify the package update scenario.
The PR also contains an example script adapted from @layus' idea to demonstrate why fetchSource could be nice.
The idea is that you would run
nix edit nixpkgs.hello, update the version or whatever. Thennix-update-src helloto prefetch-url and replace the sha256 directly. This could be combined in a nix-edit, update, build loop further down the road.At this point I am looking for feedback on the idea and naming.
Things done
build-use-sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)