-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[RFC22, RFC78] NixOS a la carte (proof of concept) #148456
Conversation
@ofborg test docker-tools etc nixpkgs openssh postgresql.postgresql_12 postgresql-container |
interesting! we've been trying to get to a faster nixos another way, by marking most modules as "optional" and having the module system not evaluate them after the initial import of their nix file unless a configurable path in |
@pennae That's also a good approach; a bit more pragmatic, but seems to need a more complicated module system and does not necessarily stimulate improvements towards RFC78 for example. Could you show what changes you had to make? |
@roberth we don't have anything for this yet since we're concentrating on doing the docs bit first (which in itself yields about a 40% improvement in system build time on this machine). this being a highly experimental endeavour we just haven't yet had the energy to spend on doing things that might end up rejected. the idea was to tag each module that isn't essential with an extra toplevel key that describes properties of the modules, leading to eg
the module system imports all modules as before, but does not evaluate such optional modules except for their |
You should be able to get about 3× faster, which is your reduction applied twice. That discrepancy can be explained by the choice of test and I was quite radical with my pruning, even going into some modules to set values to sensible defaults in order to remove more modules. It doubt whether those wins are feasible without refactoring those modules. |
oh yes, a lot of the remaining time was most likely due to a large |
16ce8ad
to
5b146af
Compare
dded1ac
to
2f1ebf0
Compare
2f1ebf0
to
d9e94ba
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/a-faster-dockertools-buildimage-prototype/16922/4 |
Idea: migrate the implementations of |
I'm closing this because the work now happens in other PRs, which tend to be linked here. |
Tracking which changes have been cleaned up and merged Note to self: might want to bundle up some of the similar and simple changes, like module extractions and adding Things not to do:
The commits of this PR and their relation to derived PRs or vice versa:
related changes |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/genodepkgs-extending-nixpkgs-nixos-to-genode/8779/7 |
Latest PR is for having a separate activation script, that can run during the build of an image EDIT: review appreciated. |
Motivation for this change
These are big goals that this PR does not achieve by itself, but works towards. The actual goal for this PR is to provide an example of the kinds of refactoring that can be done to make NixOS more modular.
What it does already achieve, is an example of how to build a
dockerTools
image using the NixOS/etc
code:So there you have it, reusing a bit of NixOS with great evaluation performance. When more modules are refactored this way, it becomes actually useful, solving a real problem in practical
dockerTools
use such as #94636) and replacing incomplete solutions like #105685.I've found that the best workflow for this refactoring is test driven development.
Things done
sandbox = true
set 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.sh
to update generated release notes