-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push bulk of sources.nix generated via niv init into a canonical URL #132
Comments
You mean
Oh, this is a lovely idea. The
Nix purists are going to hate it, but... I like it! Would could even supply a @nlewo how's that going to play with Hydra? @basvandijk @zimbatm @timbertson thoughts on this? |
whoops, fatfingered the close button.
Yeah, my bad. |
So essentially the idea is to scrap the In any case, I think this is actually a pretty good idea, but I would like to ask for a command/flag that just automatically downloads the correct |
The first thing I can come up with is keeping a list of know shas of the
I'm thinking of $ niv init --remote-sources-nix or similar during bootstrap, which would enable the new behavior. The old one should still be supported.
Let stuff to check in! Though it'll be harder for people to just tweak the sources.nix. |
@leotaku Wouldn't it be easier to update an outdated |
@masaeedu As @nmattia has already mentioned, his proposed approach to import everything into files that are edited by the user (e.g. As for simply replacing the existing
|
@leotaku If you debug/tweak your As far as my usage is concerned I don't usually tweak the sources.nix file myself; if I needed to I'd fork niv and use that as a submodule in my project. That way at least I'd be able to try and rebase my changes on top of future changes in the niv repo. This would also be the solution to avoiding internet access; I don't have to get the niv repo from the internet, I can get it from any nix derivation, including one that originates from my filesystem. I actually already require internet access today for |
I guess this is the fundamental difference in opinion. I actually don't want to see any niv related changes to source files when I'm browsing the history of my projects. I'd prefer to see niv updates as just a change in a SHA. |
@masaeedu Generally my changes to the
I'm not quite sure, but from my limited testing it should work. I think it also depends on your fetchers, if they need to download something, you of course need internet access. Do you need internet access every time you
I couldn't agree more. I guess it comes from of me wanting as few moving parts as possible and only using What do you think about @nmattia's proposal to make this configurable via a flag. This way both of our ideal workflows could be supported. |
It's not something I encounter regularly, I was just on a flight last week without internet access and discovered I couldn't nix-shell into one of my
so maybe it's not niv related?
Yeah, I definitely agree with having a flag to make it configurable, I didn't mean to imply it should be impossible to recover the old behavior. |
For reference, this is what nix-wrangle does: the generated default.nix just does some bootstrapping to import nix-wrangle from the version specified in your actual sources JSON. The nix code it imports (nix/wrangle/nix/api.nix) has the full logic around actually loading your JSON files and resolving each source. It's still not a tiny bootstrap (~20 lines), but there shouldn't be much need to change it, so it won't give much diff noise after the initial commit. Although in niv's case there's less nix code to offload into a theoretical |
Made some progress on this with @basvandijk. This sources.nix can be imported with |
Hey guys, would love your feedback on #272 |
Hi there. After running
niv init
today, I get the following code in mynix/sources.nix
:Is it possible to move the bulk of this into some canonical location in the niv repo, and instead have
niv init
generate something like:? Or better yet, just have us use that directly in our default.nix, and not generate anything besides the sources.json in our version controlled code.
The text was updated successfully, but these errors were encountered: