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>
commit7020dc8eac0e709bd69779898106789ec96b4b42
authorFélix Baylac-Jacqué <felix@alternativebit.fr>
dateThu 25 Jun 2020, 22:38 (6 years ago)
parent15c8a48
nixos/modules/services/networking/nsd.nix+4−3
@@ -11,8 +11,6 @@ let
1111
1212 # build nsd with the options needed for the given config
1313 nsdPkg = pkgs.nsd.override {
14− configFile = "${configFile}/nsd.conf";
15−
1614 bind8Stats = cfg.bind8Stats;
1715 ipv6 = cfg.ipv6;
1816 ratelimit = cfg.ratelimit.enable;
@@ -897,7 +895,10 @@ in
897895 + "want, please enable 'services.nsd.rootServer'.";
898896 };
899897
900− environment.systemPackages = [ nsdPkg ];
898+ environment = {
899+ systemPackages = [ nsdPkg ];
900+ etc."nsd/nsd.conf".source = "${configFile}/nsd.conf";
901+ };
901902
902903 users.groups.${username}.gid = config.ids.gids.nsd;
903904
pkgs/servers/dns/nsd/default.nix+1−1
@@ -11,7 +11,7 @@
1111, rrtypes ? false
1212, zoneStats ? false
1313
14−, configFile ? "etc/nsd/nsd.conf"
14+, configFile ? "/etc/nsd/nsd.conf"
1515}:
1616
1717stdenv.mkDerivation rec {