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:
parent
237af1853a
commit
bdb9cd1e17
1 changed files with 11 additions and 1 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue