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 --read-only a separate mixin #7755

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Feb 5, 2023

Motivation

This functionality was part of SourceExprCommand. However, it is actually independent parsing installables or source expressions, except for the fact that parsing installables is one of the many things influenced by read-only mode.

We can make it a mixin instead, which separates concerns.

Context

Cleaning things up so NixOS/rfcs#134 is easy to implement. We will be surgically separating InstallableCommand from SourceExprCommand as part of that, and making those simpler first helps make that task less difficult.

Depends on #7754

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or bug fix: updated release notes

It is independent of SourceExprCommand, which is about parsing
installables, except for the fact that parsing installables is one of
the many things influenced by read-only mode.
@Ericson2314
Copy link
Member Author

This is similar in spirit to #7754, which also split out a flag to a mixin.

Copy link
Contributor

@tomberek tomberek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear on whether the defaults are changing for read-only. Is InstallableCommand changing to have a default value to true now?

@thufschmitt
Copy link
Member

I'm not clear on whether the defaults are changing for read-only. Is InstallableCommand changing to have a default value to true now?

Nah, it shouldn't. The source of truth is settings.readOnlyMode which is false by default

@thufschmitt thufschmitt merged commit c7885ab into NixOS:master Feb 21, 2023
@Ericson2314 Ericson2314 deleted the mix-read-only-mode branch February 21, 2023 15:41
@Ericson2314
Copy link
Member Author

Thanks @thufschmitt for beating me to the reply :)

@tomberek I should have made clearer in the PR description that supportReadOnlyMode just controls whether the flag exists, and doesn't influence the default value of settings.readOnlyMode in any way.

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

Successfully merging this pull request may close these issues.

None yet

3 participants