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
nixos/smartd: allow extra cli options for daemon #32327
nixos/smartd: allow extra cli options for daemon #32327
Conversation
@@ -108,6 +108,18 @@ in | |||
''; | |||
}; | |||
|
|||
extraOptions = mkOption { | |||
default = ""; | |||
type = types.str; |
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.
How about types.listOf types.str
?
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 looked at several examples of an extraOptions
... option, and there seems to be a roughly 50/50 split between a single string and lists of strings. Is there a strong reason for me to change this? Do core maintainers prefer one over the other?
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 like the list type it because it allows easily merging multiple definitions. But I cannot speak for others.
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'm with @bjornfor on this for the same reason.
@GrahamcOfBorg eval |
@@ -222,7 +234,7 @@ in | |||
|
|||
path = [ pkgs.nettools ]; # for hostname and dnsdomanname calls in smartd | |||
|
|||
serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd --no-fork --configfile=${smartdConf}"; | |||
serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd ${cfg.extraOptions} --no-fork --configfile=${smartdConf}"; |
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.
Assuming the attribute is converted to a list of strings, we will need lib.concatStringsSep " " cfg.extraOptions
here.
7950252
to
c6e377f
Compare
c6e377f
to
a92f098
Compare
Forgot to rebase 😞. Will fix. Sorry to all those who got pinged for review. |
This enables further customization of smartd.
a92f098
to
0dfcd45
Compare
I think the integration check failure may have been a race condition of sorts when I pushed twice in quick succession. Is there any way to re-run the checks? |
@GrahamcOfBorg eval |
Looks good to me. Applied to master (65fb15a). Thanks! |
Motivation for this change
This enables further customization of smartd.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)