3
0
Fork 0
forked from mirrors/nixpkgs

nixos/nsd: symlink conf file to /etc/nsd

We remove the configFile build flag override in the NixOS module.

Instead of embedding the conf file link to the binaries, we symlink it
to /etc/nsd/nsd.nix, the hardcoded config file location for the
various CLI nsd utilities.

This config file build option override is triggerring a nsd rebuild
for each configuration change. This prevent us to use the nixos cache
in many cases.

Co-authored-by: Erjo <erjo@cocoba.work>
This commit is contained in:
Félix Baylac-Jacqué 2020-06-25 22:38:40 +02:00
parent 15c8a4800e
commit 7020dc8eac
No known key found for this signature in database
GPG key ID: EFD315F31848DBA4
2 changed files with 5 additions and 4 deletions
nixos/modules/services/networking
pkgs/servers/dns/nsd

View file

@ -11,8 +11,6 @@ let
# build nsd with the options needed for the given config
nsdPkg = pkgs.nsd.override {
configFile = "${configFile}/nsd.conf";
bind8Stats = cfg.bind8Stats;
ipv6 = cfg.ipv6;
ratelimit = cfg.ratelimit.enable;
@ -897,7 +895,10 @@ in
+ "want, please enable 'services.nsd.rootServer'.";
};
environment.systemPackages = [ nsdPkg ];
environment = {
systemPackages = [ nsdPkg ];
etc."nsd/nsd.conf".source = "${configFile}/nsd.conf";
};
users.groups.${username}.gid = config.ids.gids.nsd;

View file

@ -11,7 +11,7 @@
, rrtypes ? false
, zoneStats ? false
, configFile ? "etc/nsd/nsd.conf"
, configFile ? "/etc/nsd/nsd.conf"
}:
stdenv.mkDerivation rec {