-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add a unix remote store without the filesystem required mounted #9429
base: master
Are you sure you want to change the base?
Add a unix remote store without the filesystem required mounted #9429
Conversation
Could this be used to implement a "prefix rewriting store"? It would keep the existing store, but then also do path rewriting for local usage. |
Perhaps? I am not quire sure what you mean. This works just like the (unmounted) |
|
||
This store allows full access to a Nix store on a remote machine and additionally requires that the store be mounted in the local filesystem. | ||
|
||
- [`unmounted-unix://`](@docroot@/command-ref/new-cli/nix3-help-stores.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting a sense of impending combinatorial explosion here.
Mounted or not seems orthogonal to the protocol used.
Inheritance isn't suitable for arbitrary composition of orthogonal behaviors, so this suggests that the Store hierarchy should be refactored instead, to use value composition instead of inheritance for this purpose.
As far as URIs, that could exhibit as a more regular format such as
ssh-ng://foo
ssh-ng://foo?mounted=true
unix://?mounted=false
unix://
The only remaining irregularity is in the defaults, but I feel like that's expected and part of the domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the mount could be considered part of the protocol, and in a way it is, but then it should be part of the scheme, where we don't have a syntax for removing a protocol. E.g. ssh-ng+mount:
would be ok, but unix-mount:
makes no sense out of context.
Main point is the explosion of subclasses, not the syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree: we're exposing the deficiency in the current architecture. (And we're proving once again why OOP is bad / a failure --- this is supposed to be what it is good at!)
Still, I think this is useful functionality to have. And I think having a little bit of explosion to remind us that we really need to fix the arch is OK. We discussed this briefly and @roberth said then we should document that this syntax is an ugly stop-gap and better not be stabilized. Sounds great to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well-documented, explicitly experimental stop gap is ok.
5422ed3
to
7a60270
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Combinatoral class explosion postponed through experimental flag
We now have mounted/unmounted variations for both remote stores, and they both should have a better solution for this.
7a60270
to
f7fccfa
Compare
Motivation
This allows creating a proxy to access some other sort of remote store.
For example, I talked to @kolloch about using this to talk to a daemon running as a regular user which needs to do some extra auth steps access a binary cache. The credentials should be owned by that user not root / the daemon user, and it might need to e.g. spawn some sort of "did you authorize this?" GUI.
Context
A very natural follow-up from #7912 --- now we have all four combinations of
TODO needs some tests
Priorities
Add 👍 to pull requests you find important.