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
sanoid: fix sanoid.conf generation #83904
Conversation
type = types.ints.unsigned; | ||
default = 48; | ||
type = with types; nullOr ints.unsigned; | ||
default = null; |
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.
Good catch here. This was changed from using null defaults late in the review cycle for the original PR (#72060 (comment)) and I didn't consider the side effects.
cc @infinisil
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.
Agree, when reading the nixos docmentation, null
can be confusing. I'd rather like having an explicit default.
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.
This looks good and I have tested it on my systems.
The only thing I noticed is that the comment on line 13 should probably be removed because this module doesn't have defaults anymore.
We really should backport this PR to 20.03 because without it sanoid is pretty broken. We can't backport it as is because it is a breaking change, but I think backporting just the null defaults should work.
42111d9
to
23a5833
Compare
I've separated the changes in two commits so that the fix could be cherry-picked in 20.03. |
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.
Thanks for making the backport easier. I think this is ready to merge.
@infinisil perhaps you can take a look at this since you reviewed the initial sanoid PR?
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.
Could you adress the release note typo and rebase this PR?
Not a big fan of the implicit default values, but why not. @lopsided98, you're the maintainer, it's your call.
If you're ok with that, I think this PR is ready to be merged.
<listitem> | ||
<para> | ||
<literal>services.sanoid.datasets.*.useTemplate</literal> has been renamed to | ||
<literal>services.sanoid.datasets.*.useTemplate</literal> to match upstream name. |
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.
<literal>services.sanoid.datasets.*.useTemplate</literal> to match upstream name. | |
<literal>services.sanoid.datasets.*.use_template</literal> to match upstream name. |
type = types.ints.unsigned; | ||
default = 48; | ||
type = with types; nullOr ints.unsigned; | ||
default = null; |
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.
Agree, when reading the nixos docmentation, null
can be confusing. I'd rather like having an explicit default.
Is there an alternative that allows templates to work correctly? |
Didn't realize this was a problem, but fix makes sense to me. +1 |
I'm trying to find someone with merge privileges who can take a look at this PR. Could you move the release notes to 21.03 so hopefully it will be ready to merge? |
f57f200
to
9edd200
Compare
@lopsided98 I've rebased against current |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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 just realized this needs to update the NixOS test with the new option names.
@lopsided98 thanks, I've fixed |
Rebase and fix merge conflict due to the rename |
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.
It would be nice if we could map the old options to the new ones.
@SuperSandro2000 old options are now supported as you requested. |
default = []; | ||
}; | ||
useTemplate = use_template; |
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.
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.
@SuperSandro2000 AFAICS mkRenamedOptionModule
does not work for options in submodule
s, that's why I've used mkAliasDefinitions
instead.
Motivation for this change
sanoid
currently generates a bogussanoid.conf
: defaults of NixOS' options are put into templates and into datasets (making the use of templates useless).Things done
Simplify the generation of
sanoid.conf
.As in other modules like
services.postfix.config
I'm also renaming options to use original names because they are 1:1 mapping to sanoid's config.A relevant discussion, on
#nixos-dev
: