summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/tv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules/tv/default.nix')
-rw-r--r--krebs/3modules/tv/default.nix43
1 files changed, 31 insertions, 12 deletions
diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix
index 71670d33..a20801b1 100644
--- a/krebs/3modules/tv/default.nix
+++ b/krebs/3modules/tv/default.nix
@@ -1,19 +1,42 @@
-{ config, ... }:
-
with import <stockholm/lib>;
+{ config, ... }: let
+
+ hostDefaults = hostName: host: foldl' recursiveUpdate {} [
+ {
+ owner = config.krebs.users.tv;
+ }
+ (optionalAttrs (host.nets?retiolum) {
+ nets.retiolum = {
+ ip6.addr =
+ (krebs.genipv6 "retiolum" "tv" { inherit hostName; }).address;
+ };
+ })
+ (let
+ pubkey-path = ./wiregrill + "/${hostName}.pub";
+ in optionalAttrs (pathExists pubkey-path) {
+ nets.wiregrill = {
+ aliases = [
+ "${hostName}.w"
+ ];
+ ip6.addr =
+ (krebs.genipv6 "wiregrill" "tv" { inherit hostName; }).address;
+ wireguard.pubkey = readFile pubkey-path;
+ };
+ })
+ host
+ ];
-{
+in {
dns.providers = {
"viljetic.de" = "regfish";
};
- hosts = mapAttrs (_: setAttr "owner" config.krebs.users.tv) {
+ hosts = mapAttrs hostDefaults {
alnus = {
ci = true;
cores = 2;
nets = {
retiolum = {
ip4.addr = "10.243.21.1";
- ip6.addr = "42::2101";
aliases = [
"alnus.r"
];
@@ -38,7 +61,6 @@ with import <stockholm/lib>;
nets = {
retiolum = {
ip4.addr = "10.243.20.1";
- ip6.addr = "42::2001";
aliases = [
"mu.r"
];
@@ -79,7 +101,6 @@ with import <stockholm/lib>;
retiolum = {
via = config.krebs.hosts.ni.nets.internet;
ip4.addr = "10.243.113.223";
- ip6.addr = "42:4522:25f8:36bb:8ccb:150:231a:2af4";
aliases = [
"ni.r"
"cgit.ni.r"
@@ -100,6 +121,9 @@ with import <stockholm/lib>;
-----END RSA PUBLIC KEY-----
'';
};
+ wiregrill.wireguard.subnets = [
+ (krebs.genipv6 "wiregrill" "tv" 0).subnetCIDR
+ ];
};
ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILGDdcKwFm6udU0/x6XGGb87k9py0VlrxF54HeYu9Izb";
};
@@ -114,7 +138,6 @@ with import <stockholm/lib>;
};
retiolum = {
ip4.addr = "10.243.0.110";
- ip6.addr = "42:2d5:733f:d6da:c0f5:2bb7:2b18:9ec";
aliases = [
"nomic.r"
"cgit.nomic.r"
@@ -158,7 +181,6 @@ with import <stockholm/lib>;
};
retiolum = {
ip4.addr = "10.243.13.37";
- ip6.addr = "42::1337";
aliases = [
"wu.r"
"cgit.wu.r"
@@ -185,7 +207,6 @@ with import <stockholm/lib>;
nets = {
retiolum = {
ip4.addr = "10.243.22.22";
- ip6.addr = "42::2222";
aliases = [
"querel.r"
];
@@ -226,7 +247,6 @@ with import <stockholm/lib>;
};
retiolum = {
ip4.addr = "10.243.13.38";
- ip6.addr = "42::1338";
aliases = [
"xu.r"
"cgit.xu.r"
@@ -261,7 +281,6 @@ with import <stockholm/lib>;
};
retiolum = {
ip4.addr = "10.243.13.40";
- ip6.addr = "42::1340";
aliases = [
"zu.r"
];