nixpkgs/nixos
aszlig 94bc38e6c1
nixos/bind: Allow to set extra options
BIND doesn't allow the options section (or any section I'd guess) to be
defined more than once, so whenever you want to set an additional option
you're stuck using weird hacks like this:

services.bind.forwarders = lib.mkForce [ "}; empty-zones-enable no; #" ];

This basically exploits the fact that values coming from the module
options aren't escaped and thus works in a similar vain to how SQL
injection works.

Another option would be to just set configFile to a file that includes
all the options, including zones. That obviously makes the configuration
way less extensible and more awkward to use with the module system.

To make sure this change does work correctly I added a small test just
for that. The test could use some improvements, but better to have a
test rather than none at all. For a future improvement the test could be
merged with the NSD test, because both use the same zone file format.

This change has been reviewed in #40053 and after not getting any
opposition, I'm hereby adding this to master.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @peti, @edolstra
Closes: #40053
2018-05-30 05:07:39 +02:00
..
doc Kubernetes: 2018-05-26 11:19:12 +02:00
lib nixos/lib/make-ext4-fs: Add a sanity check 2018-05-05 19:30:54 +03:00
maintainers Fix kernel crash caused by absent root device 2018-05-12 02:55:33 +03:00
modules nixos/bind: Allow to set extra options 2018-05-30 05:07:39 +02:00
tests nixos/bind: Allow to set extra options 2018-05-30 05:07:39 +02:00
COPYING
default.nix nixos: export packages of the current configuration (its pkgs argument) 2018-02-09 19:35:27 +00:00
README
release-combined.nix nixos/release-combined.nix: fix eval of tested job 2018-05-11 00:47:43 +02:00
release-small.nix Add the boot test to release-small.nix 2018-02-27 20:09:07 +01:00
release.nix nixos/bind: Allow to set extra options 2018-05-30 05:07:39 +02:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.