summaryrefslogtreecommitdiffstats
path: root/krebs/4lib
diff options
context:
space:
mode:
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;