1
0
Fork 0
nixos-config/common/default.nix

155 lines
3.4 KiB
Nix
Raw Normal View History

2018-06-09 00:41:23 +00:00
{
2022-03-08 01:42:46 +00:00
config,
pkgs,
lib,
...
}:
with lib; {
2019-07-31 21:56:52 +00:00
config = {
2020-12-01 11:17:10 +00:00
m-0.monitoring = [
{
host = "apollo:9100";
name = "apollo";
flaky = true;
}
{
host = "apollo:9558";
name = "apollo-user";
flaky = true;
}
2021-08-03 21:23:15 +00:00
{
host = "hera:9558";
name = "hera-user";
flaky = true;
}
{
host = "zeus:9100";
name = "zeus";
flaky = true;
}
{
host = "zeus:9558";
name = "zeus-user";
flaky = true;
2020-12-01 11:17:10 +00:00
}
2021-12-21 22:47:38 +00:00
{
host = "fluffy.vpn.m-0.eu:9100";
name = "fluffy";
}
2020-12-01 11:17:10 +00:00
{
name = "ved server";
host = "bach.vocalensemble-darmstadt.de:9100";
}
{
name = "ved postfix";
host = "bach.vocalensemble-darmstadt.de:9154";
}
];
};
2019-07-31 21:56:52 +00:00
2023-03-04 14:31:14 +00:00
options.m-0 = {
prefix = mkOption {
2019-07-31 21:56:52 +00:00
default = "2a02:c207:3002:7584";
type = types.str;
};
2023-03-04 14:31:14 +00:00
monitoring = mkOption {
2019-07-31 21:56:52 +00:00
type = types.listOf (types.submodule {
options = {
2022-03-08 01:42:46 +00:00
name = mkOption {type = types.str;};
host = mkOption {type = types.str;};
2020-12-01 11:17:10 +00:00
container = mkOption {
type = types.bool;
default = false;
};
flaky = mkOption {
type = types.bool;
default = false;
};
2019-03-07 22:59:21 +00:00
};
2019-07-31 21:56:52 +00:00
});
2022-03-08 01:42:46 +00:00
default = [];
2019-07-31 21:56:52 +00:00
};
2023-03-04 15:29:32 +00:00
headscaleIPs = mkOption {
2023-03-04 14:31:14 +00:00
type = types.listOf types.string;
2023-03-04 15:29:32 +00:00
default = [
"100.64.7.0/24"
"fd7a:115c:a1e0:77::/64"
];
2023-03-04 14:31:14 +00:00
};
virtualHosts = mkOption {
type = types.attrs;
};
hosts = mkOption {
2019-07-31 21:56:52 +00:00
type = types.attrs;
2022-03-08 01:42:46 +00:00
default = let
p = config.m-0.prefix;
hera-p = "${p}::3";
wg-p = "${p}::100";
v4-p = "10.0.0";
2023-03-04 14:31:14 +00:00
in {
2023-03-04 05:07:58 +00:00
hera = "${p}::1";
2022-03-08 01:42:46 +00:00
vpn = rec {
prefix = "fdc0:7";
hera = "${prefix}::1";
fluffy = "${prefix}::2";
apollo = "${prefix}::5";
zeus = "${prefix}::4";
pegasus = "${prefix}::6";
};
hera-wg-host = "${p}::100:0:1";
2019-02-24 23:31:53 +00:00
2022-03-08 01:42:46 +00:00
hera-v4 = "213.136.94.190";
2019-02-24 23:31:53 +00:00
2022-03-08 01:42:46 +00:00
hera-wg = "${wg-p}:1";
apollo-wg = "${wg-p}:2";
zeus-wg = "${wg-p}:3";
2022-03-08 01:42:46 +00:00
hera-intern = "${hera-p}:1";
chor-cloud = "${hera-p}:b";
2022-03-08 01:42:46 +00:00
hera-intern-v4 = "${v4-p}.1";
chor-cloud-intern-v4 = "${v4-p}.3";
2023-03-04 02:27:06 +00:00
# generate with:
2023-03-04 03:56:17 +00:00
# (echo '{' && tailscale status -json | jq -r '.Self,.Peer[] | .DNSName[:-17] + " = { A = \"" + .TailscaleIPs[0] + "\"; AAAA = \"" + .TailscaleIPs[1] + "\";};"' && echo '}') > common/tailscale.nix
2023-03-04 02:27:06 +00:00
tailscale = import ./tailscale.nix;
2023-03-04 15:29:32 +00:00
publicAliases = {
hera = [
"blog"
"cloud"
"git"
"lists"
"matrix"
"rpg"
];
};
2023-03-04 05:28:48 +00:00
aliases = {
2023-03-04 13:13:45 +00:00
hera = [
"alerts"
"analytics"
"blog"
"ci"
"cloud"
"element"
"fdroid"
"firefox-sync"
"git"
2023-03-04 13:44:41 +00:00
"lists"
2023-03-04 13:13:45 +00:00
"matrix"
2023-03-04 13:44:41 +00:00
"monitoring"
2023-03-04 13:13:45 +00:00
"rpg"
2023-03-04 13:44:41 +00:00
"rspamd"
"rss"
2023-03-04 14:31:14 +00:00
"stats"
2023-03-04 13:13:45 +00:00
"stream"
2023-03-04 13:44:41 +00:00
"syncthing-hera"
2023-03-04 13:13:45 +00:00
"tasks"
];
2023-03-07 23:45:34 +00:00
fluffy = ["home" "syncthing-fluffy" "5e"];
2023-03-04 05:28:48 +00:00
zeus = ["syncthing-zeus"];
apollo = ["syncthing-apollo"];
2023-03-04 05:03:54 +00:00
};
2022-03-08 01:42:46 +00:00
};
2018-06-09 00:41:23 +00:00
};
};
}