mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-09 05:33:25 +00:00
commit
dcdd9487ec
@ -44,6 +44,9 @@ let
|
|||||||
})
|
})
|
||||||
else "";
|
else "";
|
||||||
|
|
||||||
|
parseModules = x:
|
||||||
|
x // { connectTo = mapAttrs (name: value: { inherit (value) password publicKey; }) x.connectTo; };
|
||||||
|
|
||||||
# would be nice to merge 'cfg' with a //,
|
# would be nice to merge 'cfg' with a //,
|
||||||
# but the json nesting is wacky.
|
# but the json nesting is wacky.
|
||||||
cjdrouteConf = builtins.toJSON ( {
|
cjdrouteConf = builtins.toJSON ( {
|
||||||
@ -53,8 +56,8 @@ let
|
|||||||
};
|
};
|
||||||
authorizedPasswords = map (p: { password = p; }) cfg.authorizedPasswords;
|
authorizedPasswords = map (p: { password = p; }) cfg.authorizedPasswords;
|
||||||
interfaces = {
|
interfaces = {
|
||||||
ETHInterface = if (cfg.ETHInterface.bind != "") then [ cfg.ETHInterface ] else [ ];
|
ETHInterface = if (cfg.ETHInterface.bind != "") then [ (parseModules cfg.ETHInterface) ] else [ ];
|
||||||
UDPInterface = if (cfg.UDPInterface.bind != "") then [ cfg.UDPInterface ] else [ ];
|
UDPInterface = if (cfg.UDPInterface.bind != "") then [ (parseModules cfg.UDPInterface) ] else [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
privateKey = "@CJDNS_PRIVATE_KEY@";
|
privateKey = "@CJDNS_PRIVATE_KEY@";
|
||||||
@ -151,12 +154,14 @@ in
|
|||||||
|
|
||||||
ETHInterface = {
|
ETHInterface = {
|
||||||
bind = mkOption {
|
bind = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
example = "eth0";
|
example = "eth0";
|
||||||
description = ''
|
description =
|
||||||
Bind to this device for native ethernet operation.
|
''
|
||||||
'';
|
Bind to this device for native ethernet operation.
|
||||||
};
|
<literal>all</literal> is a pseudo-name which will try to connect to all devices.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
beacon = mkOption {
|
beacon = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
|
Loading…
Reference in New Issue
Block a user