What’s all this then?
I’ve seen multiple places where it’s mentioned that Nix{,OS}[1] can act as a source distribution where all building is done locally and no binaries are fetched online, but I had trouble finding search hits for what properties you set to ensure this occurs, so I am starting this thread to pull some loose ends together (puns about fabric threads unintended). Hopefully it helps others, and I can gain some agreement that I didn’t follow the wrong garden path.
Recap of The Noise
If it helps, I’d like to point out that there’s actually a significant amount of noise vs. signal when trying to find out how to do this. Here’s what I mean and some of my suggestions, for which I’d be interested to hear if anyone agrees with the suggestions:
Searching for threads did not immediately generate a clear solution
- A web search resulted in me finding the thread Is NixOS a source distro or a binary distro, or both? - NixOS Discourse among other threads, but there seem to be no threads talking about how to actually enforce NixOS to avoid binary downloads and rely on local buliding. I was going to post there, but this is now more of a “how can we make NixOS a fully local-build source distribution post” and that thread is old and the system gives me a warning about it, so I’m creating a new thread.
- Based on How to make a version compatable config for
nix.binaryCaches
ornix.settings.substituters
?, it seems that you disablenix.binaryCaches
somehow? I see the second property mentioned there, nix.settings.substituters, on the search, but not the other.
The NixOS wiki doesn’t yet return clear and helpful results for this question
- Specifically, the NixOS wiki search for binary cache doesn’t return with much.
The top page does seem to address substituters, but it would be great to see a section detailing how to explicitly disable all substituters, if for nothing else than improving searchability on this topic.- Especially if there’s no
substituters.disable
, then it’s worth pointing that out and detailing how to set the list to empty with an example, etc. The section could explain why you would or wouldn’t want to do this (could highlight the paranoid, binary-averse, or otherwise super-geek lifestyles).
- Especially if there’s no
The NixOS Option search for binary cache doesn’t yet returns clear results
It does have a lot of results, but none of them immediately look right or shout out at someone who doesn’t already know the answer.
- If the substituters tip from above is true, then for searchability, I wager the word
substituters
needs to show up in far more places[2] in order to get that to be the term people search.- If still true, and there’s any way to promote that setting to number one, it would help. I’m not sure how the
best match
algorithm works.
- If still true, and there’s any way to promote that setting to number one, it would help. I’m not sure how the
- The stable NixOS Manual’s nearest heading does provides a CLI option, but I’d want it in my system configuration file, permanently, so as not to forget or need to type it each time. I’d rather not get hacky with an alias or function for some sort of
nixos-rebuild
override.- There’s actually no mention of the word
substituters
in the whole unstable manual.
- There’s actually no mention of the word
Request for Signal
So, I have some good stuff to try and dig into, but I may as well ask after having written up the notes…
- Is there an easy
disable
option to get Nix{,OS} to build everything locally? In the recent verbiage, is it the same to say “how do you disable substituters globally”? - If not, do you just configure an empty substituters list?
- Have I missed the obvious web-pages where this is already discussed? Threads where this was hammered time and time again that I should have caught? If so, let’s get them linked here and future web-searchers may arrive to those instead.
Further Curiosities
So let’s say it’s just a matter of disabling the substituters and you are officially building locally.
What actually happens under the hood when you decide to switch to this? Is anyone already running a system this way? I expect NixOS may just grab tarballs and build them?
Setting the goal post
My goal is to have the source code repositories of all the software I use available locally, does NixOS or any other source distribution do that? If you’re familiar with the foo-git
style packages in the AUR[3], that’s not far from what I’m imagining.
The system would have all software as some clone or meta-clone of the upstream repos, and the user would just git pull
and make
, more or less. Nix{,OS} still seems like it would serve this sort of need handily, and may already do it. I’ve recently come across Guix and it seems to be GNU flavored Nix that does something like this, but I’m still on the opening pages of the manual.
Any thoughts?
There’s a lot here so don’t fret to pick a tiny piece. I’m listening
Cheers.
Footnotes
- [1] (both, either, I won’t distinguish here too much)
- [2] (docs, wikis, searches, threads, etc. – oh, hey – look – I’m doing my part )
- [3] Sample: AUR (en) - whipper-git