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

nixos/smartd: allow extra cli options for daemon #32327

Conversation

kevin-hanselman
Copy link
Contributor

Motivation for this change

This enables further customization of smartd.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -108,6 +108,18 @@ in
'';
};

extraOptions = mkOption {
default = "";
type = types.str;
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Member

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.

@grahamc
Copy link
Member

grahamc commented Dec 5, 2017

@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}";
Copy link
Member

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.

@kevin-hanselman
Copy link
Contributor Author

kevin-hanselman commented Dec 19, 2017

Forgot to rebase 😞. Will fix. Sorry to all those who got pinged for review.

This enables further customization of smartd.
@zimbatm zimbatm removed their request for review December 19, 2017 10:32
@ttuegel ttuegel removed their request for review December 19, 2017 14:10
@kevin-hanselman
Copy link
Contributor Author

kevin-hanselman commented Dec 19, 2017

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?

@bjornfor
Copy link
Contributor

@GrahamcOfBorg eval

@bjornfor
Copy link
Contributor

Looks good to me. Applied to master (65fb15a). Thanks!

@bjornfor bjornfor closed this Dec 19, 2017
@kevin-hanselman kevin-hanselman deleted the smartd_expose_cli_options branch January 3, 2018 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants