-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 use-registries config option (and deprecate --no-registries
)
#4976
Conversation
Isn’t it simpler to just set |
That was my first thought as well, but emptying |
Until this is merged, it is also possible to simply specify an empty registry, to simulate no registry: # registry.json
{
"version": 2
} But I agree that a config option is better. |
Once again, this doesn't quite work since there are also user and system registries. |
@@ -102,7 +102,7 @@ struct LockFlags | |||
|
|||
/* Whether to use the registries to lookup indirect flake | |||
references like 'nixpkgs'. */ | |||
bool useRegistries = true; | |||
std::optional<bool> useRegistries = std::nullopt; |
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.
A tristate is confusing to me, maybe it should just be initialized to settings.registries
?
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 have thought about this a bit, I don't like initializing fields with global state. It may be confusing if the state changes after the structure has been initialized, since then lockFlags.useRegistries
may go out of sync with settings.useRegistries
.
859e612
to
82148d7
Compare
--no-registries
)
Some people want to avoid using registries at all on their system; Instead of having to add --no-registries to every command, this commit allows to set use-registries = false in the config. --no-registries is still allowed everywhere it was allowed previously, but is now deprecated. Co-authored-by: Eelco Dolstra <[email protected]>
82148d7
to
3e57e34
Compare
--no-registries
)--no-registries
)
--no-registries
)--no-registries
)
Some people want to avoid using registries at all on their system; Instead
of having to add --no-registries to every command, this commit allows to
set registries = false in the config. --no-registries is still allowed
everywhere it was allowed previously, but now as a shorthand to --option
registries false rather than a separate flag.