summary refs log tree commit diff
path: root/modules/services/networking/dnsmasq.nix
diff options
context:
space:
mode:
authorRickard Nilsson <rickynils@gmail.com>2012-11-12 17:58:48 +0100
committerRickard Nilsson <rickynils@gmail.com>2012-11-12 18:16:04 +0100
commit02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4 (patch)
treef3e9a79a62c75d86af39a04d47a82e2e708e9ce0 /modules/services/networking/dnsmasq.nix
parent2f833bc88dc8c1111bdedf1355a0920c9d5fb823 (diff)
downloadnixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar.gz
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar.bz2
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar.lz
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar.xz
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.tar.zst
nixpkgs-02e0d7dbc349e8d59a58f1cc23497b1c1d3ff3c4.zip
dnsmasq: Add extraConfig option
Diffstat (limited to 'modules/services/networking/dnsmasq.nix')
-rw-r--r--modules/services/networking/dnsmasq.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/services/networking/dnsmasq.nix b/modules/services/networking/dnsmasq.nix
index 0d786add881..b726493d421 100644
--- a/modules/services/networking/dnsmasq.nix
+++ b/modules/services/networking/dnsmasq.nix
@@ -8,6 +8,10 @@ let
 
   serversParam = concatMapStrings (s: "-S ${s} ") cfg.servers;
 
+  dnsmasqConf = pkgs.writeText "dnsmasq.conf" ''
+    ${cfg.extraConfig}
+  '';
+
 in
 
 {
@@ -33,6 +37,15 @@ in
         '';
       };
 
+      extraConfig = mkOption {
+        type = types.string;
+        default = "";
+        description = ''
+          Extra configuration directives that should be added to
+          <literal>dnsmasq.conf</literal>
+        '';
+      };
+
     };
 
   };
@@ -49,7 +62,7 @@ in
 
         daemonType = "daemon";
 
-        exec = "${dnsmasq}/bin/dnsmasq -R ${serversParam} -o";
+        exec = "${dnsmasq}/bin/dnsmasq -R ${serversParam} -o -C ${dnsmasqConf}";
       };
 
   };