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/nullmailer: fixes and remotesFile option #29890

Merged
merged 4 commits into from Sep 28, 2017
Merged

Conversation

mbrgm
Copy link
Member

@mbrgm mbrgm commented Sep 28, 2017

Motivation for this change

Please see individual commit messages.

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
    • Linux
  • 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.

The current `remotes` option is a string option containing nullmailer remote
definitions. However, those definitions may contain secret credentials and
should therefore not be put world-readable in the nix store.

I added a `remotesFile` option, which allows to specify a path to the remotes
definition file instead. This way, the definitions can be kept outside of the
nix store with more secure file permissions.
attrs' = builtins.filter (attr: ! isNull (getval attr)) attrs;
in foldl' (as: attr: as // { "nullmailer/${attr}".text = getval attr; }) {} attrs';
remotesFilter = if cfg.remotesFile != null
then (attr: attr != "remotes")
Copy link
Member

Choose a reason for hiding this comment

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

The assertion prevents this case already.

@Mic92 Mic92 changed the title nullmailer: fixes and remotesFile option nixos/nullmailer: fixes and remotesFile option Sep 28, 2017
(foldl' (as: attr: as // { "nullmailer/${attr}".text = getval attr; }) {} attrs')
// optionalRemotesFileLink;
(foldl' (as: name: as // { "nullmailer/${name}".text = validAttrs.${name}; }) {} (attrNames validAttrs))
// optionalAttrs (cfg.remotesFile != null) { "nullmailer/remotes".source = cfg.remotesFile; };
Copy link
Member

Choose a reason for hiding this comment

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

Can you check if it still works? My simple tests say yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, everything working.

@Mic92 Mic92 merged commit 12ac88a into NixOS:master Sep 28, 2017
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

2 participants