From bdb9cd1e172af5895cb47c1266350cd53edd0a47 Mon Sep 17 00:00:00 2001 From: Tomas Hlavaty Date: Mon, 2 Jan 2017 19:26:48 +0100 Subject: [PATCH] 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). --- nixos/modules/services/networking/cjdns.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 + /etc/hosts. 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 );