feat(nix): Enable persistent volume for shared nix-store - #1127
Merged
Samruddhi Khandale (samruddhikhandale) merged 5 commits intoSep 25, 2024
Merged
Conversation
Samruddhi Khandale (samruddhikhandale)
requested changes
Sep 23, 2024
Flo (max06)
force-pushed
the
nix-store-volume
branch
2 times, most recently
from
September 25, 2024 14:57
d52a6da to
260aeae
Compare
Contributor
Author
|
All tests green - on my machine. Let's hope CI gets the same result 😄 |
Samruddhi Khandale (samruddhikhandale)
requested changes
Sep 25, 2024
… package used in test
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
Flo (max06)
force-pushed
the
nix-store-volume
branch
from
September 25, 2024 22:52
087a63d to
371b3bb
Compare
Samruddhi Khandale (samruddhikhandale)
approved these changes
Sep 25, 2024
Samruddhi Khandale (samruddhikhandale)
left a comment
Member
There was a problem hiding this comment.
Looks great, thank you! ⚡
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #284
Enables a shared, persistent docker volume for /nix/store.
Garbage collection is no issue since nix simply refetches everything that's missing. On the other hand this volume will probably save a lot of storage and bandwidth due to deduplication.
My use case: I enabled the nix feature per default for every devcontainer, to be used with my dotfiles-repo (and home-manager).
Alternative: Duplicate feature to have both options, one with cache, one without.
Update
The nix-store volumes are no longer shared with all containers using this feature. Nix (or it's store) does not seem to be ready for shared access. Instead, every devcontainer using this feature gets its own persistent store volume. This reduces the rebuild-times and data transfer, but not as much as a the shared store. Imo, still a useful change.
The diff looks bad, but it's just because I removed one if-else-condition spanning 55 lines.
(Wrong statement about renamed package removed)