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
Bundle an expression that produces the smallest viable NixOS image #21315
Comments
|
You mentioned |
|
@danbst I might include nano or something, but given that it contains |
|
Are you aware of not-os? I think it's not far off from what you want, though the intended use is somewhat different. |
|
some recent changes i did in not-os allow nix-daemon to work, with sandboxes builds, its currently targeting ARM but i can make it work on x86 as well |
|
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
|
This sounds very interesting, even though the issue is very old. Let me try to analyze the problem with some examples along the way. Let's take the minimal profile and construct a system closure: Its What seems suspicious to me in this configuration:
This is by no means a complete analysis - but some starting points for slimming down a NixOS profile are present, and could be a good way to jumpstart solving this issue. |
|
#97565 is relevant. Generally, a lot of things for this kind of image should be moved to defaultPackages. |
|
I've started a separate project to achieve the solution to this issue (and eventually incorporate it in Nixpkgs): nixos-super-minimal. To people interested in this challenge: consider joining forces in identifying extraneous packages and their sources! |
@kisik21 i support the initial idea of this issue. that's why i introduced |
|
I marked this as stale due to inactivity. → More info |
|
still important |
|
Just to provide some info, atm, NixOS images generated by make-disk-image for QEMU tests seems to include documentation, manual, texinfo-interactive and some stuff like that. There seems to be room for improvement to reduce the image ( Reducing further to 200MB requires work on Perl/Python3 dependencies. For Perl, it seems not that hard. For Python, uncertain of what does it cost to achieve. |
|
Python dependencies, in my personal experience, are rather large. It might be wise not to ship too much Python code in minimal images, if possible. |
Can we have a canonical configuration.nix and script wrapper that produces the smallest self-sufficient NixOS image we can achieve, that can then be expanded into a more complete system?
Basically, I'd expect it to have:
environment.systemPackages(then again, I want that in all my images 😛)systemdnix-daemonand a RO storesshdnixos-rebuildfrom within the imageI know that we have a minimal.nix module but the result of that still includes a load of stuff that you don't need to get started.
It'd be interesting to include the image in Hydra and plot its size over time to make sure we don't accidentally pick up silly things in runtime closures.
My goal would be for it to not be much bigger than comparable offerings from Alpine Linux and the like. It would probably be larger at first, but we could whittle it down over time.
The text was updated successfully, but these errors were encountered: