summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorTomas Hlavaty <tom@logand.com>2017-01-02 19:26:48 +0100
committerJoachim Fasting <joachifm@fastmail.fm>2017-01-02 19:31:37 +0100
commitbdb9cd1e172af5895cb47c1266350cd53edd0a47 (patch)
treefceb32bbdaaeca0e16ed671e7543b1b12e3838e6 /nixos/modules/services
parent237af1853a795356bb8d693c29ad1d319943f94e (diff)
downloadnixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar.gz
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar.bz2
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar.lz
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar.xz
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.tar.zst
nixlib-bdb9cd1e172af5895cb47c1266350cd53edd0a47.zip
cjdns service: optionally add cjdns hosts to networking.extraHosts
Enabling this incurs a heavy eval-time cost, but it's a nice usability
enhancement; satisfy both concerns by making it optional (default
false).
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/networking/cjdns.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/cjdns.nix b/nixos/modules/services/networking/cjdns.nix
index 839a5bf07389..a10851c16523 100644
--- a/nixos/modules/services/networking/cjdns.nix
+++ b/nixos/modules/services/networking/cjdns.nix
@@ -195,6 +195,16 @@ in
         };
       };
 
+      addExtraHosts = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to add cjdns peers with an associated hostname to
+          <filename>/etc/hosts</filename>.  Beware that enabling this
+          incurs heavy eval-time costs.
+        '';
+      };
+
     };
 
   };
@@ -257,7 +267,7 @@ in
       };
     };
 
-    networking.extraHosts = cjdnsExtraHosts;
+    networking.extraHosts = mkIf cfg.addExtraHosts cjdnsExtraHosts;
 
     assertions = [
       { assertion = ( cfg.ETHInterface.bind != "" || cfg.UDPInterface.bind != "" || cfg.confFile != null );