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: add option for notifiction email sender #91432

Merged
merged 1 commit into from Aug 5, 2020

Conversation

tmplt
Copy link
Member

@tmplt tmplt commented Jun 24, 2020

Motivation for this change

I have a dedicated robots@domain.tld email I want to use when automatically reporting errors to myself. The current configuration of services.smartd requires one to send an email from root@domain.tld if services.smartd.notifictions.mail.sender is configured for msmtp.

This new option allows the sender in the email's From field to be configured, and uses root as default, mirroring present behavior.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@tmplt
Copy link
Member Author

tmplt commented Jun 24, 2020

This is a minor change. Should it be merged into release-20.03 instead?

@tmplt tmplt changed the title nixos/smartd: add option for notifiction email envelope sendor nixos/smartd: add option for notifiction email sender Jun 24, 2020
@dasJ
Copy link
Member

dasJ commented Jun 28, 2020

Backporting doesn't really work that way. The BACK part of backporting menas it's already on master. If you just merged this into 20.03, it wouldn't be on master, and would hence be missing on 20.09. Therefore, you need to target master with this PR and backport it in a second PR after this one is merged.

Also, this is not really a backport-worthy change imo, since it introduces a new feature instead of fixing a bug or fixing a security vulnerability.

@dasJ
Copy link
Member

dasJ commented Jun 28, 2020

Yes! It's probably documented somewhere but I don't know where. You can just place this module anywhere and import it like imports = [ ./modules/smartd.nix ];. This would not work because all options defined in the nixos module will conflict with your options here. You can fix that by disabling the module from nixos using disabledModules = [ "services/monitoring/smartd.nix" ];

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/243

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

diff LGTM

I agree with @dasJ that the backport shouldn't happen, but looks good for master

@jonringer jonringer merged commit f9f4825 into NixOS:master Aug 5, 2020
@rtldg
Copy link
Contributor

rtldg commented Aug 5, 2020

The option description breaks building the docbook.

...
building '/nix/store/vzp0b80cbdbpnq5cxaj6z6kh543d1s12-options-docbook.xml.drv'...
intermediate.xml:51743: parser error : Opening and ending tag mismatch: literal line 51743 and email
Acts as the value of <literal>email</email> in the emails' <literal>From: ... <e
                                           ^
intermediate.xml:51743: parser error : Opening and ending tag mismatch: email line 51743 and literal
ue of <literal>email</email> in the emails' <literal>From: ... <email></literal>
...

It should probably have Acts as the value of <literal>email</literal> in the emails' <literal>From: ... &lt;email&gt;</literal> field.

@jonringer
Copy link
Contributor

@rtldg how do I build docbook?

@jonringer
Copy link
Contributor

figured it out nix-build nixos/release.nix -A manual.x86_64-linux

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

5 participants