summaryrefslogtreecommitdiffstats
path: root/krebs/4lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-08-02 20:58:42 +0200
committertv <tv@krebsco.de>2016-08-02 20:58:42 +0200
commite6aef09ad41cd55d716b8ee276ebd774b95d8ecb (patch)
tree6d8d5cce976f3843ab196367e82fec56f0798838 /krebs/4lib
parent0928cc03a6191640c66c9122159994855527faef (diff)
parentb197949ab83ee3ee87b5774e0fc7c8d0123a6708 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/4lib')
-rw-r--r--krebs/4lib/default.nix1
-rw-r--r--krebs/4lib/types.nix14
2 files changed, 14 insertions, 1 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index 8a822ed7d..49241cc82 100644
--- a/krebs/4lib/default.nix
+++ b/krebs/4lib/default.nix
@@ -33,6 +33,7 @@ let out = import <stockholm/lib> // rec {
dir.has-default-nix = path: pathExists (path + "/default.nix");
genid = import ./genid.nix { lib = lib // out; };
+ genid_signed = x: ((genid x) + 16777216) / 2;
git = import ./git.nix { lib = lib // out; };
tree = import ./tree.nix { inherit lib; };
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 8906eff4a..37d44606b 100644
--- a/krebs/4lib/types.nix
+++ b/krebs/4lib/types.nix
@@ -130,16 +130,28 @@ types // rec {
type = str;
default = concatStringsSep "\n" (
(optionals (net.via != null)
- (map (a: "Address = ${a}") net.via.addrs))
+ (map (a: "Address = ${a} ${toString config.port}") net.via.addrs))
++
(map (a: "Subnet = ${a}") net.addrs)
++
+ [config.extraConfig]
+ ++
[config.pubkey]
);
};
pubkey = mkOption {
type = tinc-pubkey;
};
+ extraConfig = mkOption {
+ description = "Extra Configuration to be appended to the hosts file";
+ default = "";
+ type = string;
+ };
+ port = mkOption {
+ type = int;
+ description = "tinc port to use to connect to host";
+ default = 655;
+ };
};
}));
default = null;