Skip to content
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

make NixOS more SSD-friendly #46109

Closed
KiaraGrouwstra opened this issue Sep 5, 2018 · 5 comments
Closed

make NixOS more SSD-friendly #46109

KiaraGrouwstra opened this issue Sep 5, 2018 · 5 comments

Comments

@KiaraGrouwstra
Copy link
Contributor

I've installed NixOS on my 128 GB SSD, but every so often find myself running out of space, despite the occasional maintenance.

NixOS solves reproducability at the cost of storing multiple OS revisions.
SSDs give increased performance, but are costlier, meaning they'll generally easily get full.

It'd be great to get the best of both here. I think this would look like having most of /nix/store installed on an HDD, while allowing anything part of the 'active' revision to get copied to an SSD for the performance boost.

I don't know if anyone has considered this so far, or if this should go in Nix instead, but I wanted to just put this out there to gather feedback / thoughts.

@DIzFer
Copy link
Contributor

DIzFer commented Sep 5, 2018

AFAIK, solving this is as simple as configuring the mountpoint for /nix/store, via fileSystems."/nix/store".*. By its very nature, NixOS doesn't have this kind of defaults, since it's a particular configuration step that depends on user preference and hardware layout. Therefore, there's nothing really to do on the coding side.

However, I think that would be missing the point of having an SSD, since then all your software would be on a slow device. I'd suggest looking into bcache{,fs}, so that it's your kernel the one to decide where to put each bit.

@vcunat
Copy link
Member

vcunat commented Sep 6, 2018

Yes, but for SSDs it seems best to use nix.autoOptimiseStore = true; – that can be expensive on rotating HDDs, which is possibly why it isn't the default.

@vcunat
Copy link
Member

vcunat commented Sep 6, 2018

BTW, for combining SSD and a rotating HDD you may want to use general solutions such as bcache.

@KiaraGrouwstra
Copy link
Contributor Author

That sounds great, I'll try -- thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@vcunat @KiaraGrouwstra @DIzFer and others