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).
This commit is contained in:
Tomas Hlavaty 2017-01-02 19:26:48 +01:00 committed by Joachim Fasting
parent 237af1853a
commit bdb9cd1e17

@ -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 );