2023-04-21 09:20:23 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
2023-09-12 20:07:05 +00:00
|
|
|
flake,
|
2023-04-21 09:20:23 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
psCfg = config.pub-solar;
|
|
|
|
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
|
|
|
in {
|
|
|
|
age.secrets."cat-test.ovpn" = {
|
2023-09-12 20:07:05 +00:00
|
|
|
file = "${flake.self}/secrets/cat-test.ovpn";
|
2023-04-21 09:20:23 +00:00
|
|
|
mode = "700";
|
|
|
|
owner = psCfg.user.name;
|
|
|
|
};
|
|
|
|
|
|
|
|
age.secrets.".fwknoprc" = {
|
2023-09-12 20:07:05 +00:00
|
|
|
file = "${flake.self}/secrets/.fwknoprc";
|
2023-04-21 09:20:23 +00:00
|
|
|
mode = "600";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.openvpn.servers = {
|
|
|
|
catVPN = {
|
2023-07-24 13:04:43 +00:00
|
|
|
autoStart = false;
|
2023-05-05 12:17:14 +00:00
|
|
|
config = ''config ${config.age.secrets."cat-test.ovpn".path}'';
|
2023-04-21 09:20:23 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-05-05 12:17:14 +00:00
|
|
|
systemd.services.openvpn-catVPN.serviceConfig.ExecStartPre = "${pkgs.fwknop}/bin/fwknop --rc-file=${config.age.secrets.".fwknoprc".path} --no-save-args --no-home-dir --save-args-file=/dev/null -n hetzner_test_cloud --wget-cmd=${pkgs.wget}/bin/wget";
|
|
|
|
|
2023-04-21 09:20:23 +00:00
|
|
|
home-manager = pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
|
|
|
|
programs.ssh = {
|
|
|
|
matchBlocks = {
|
|
|
|
"salt.base.test" = {
|
|
|
|
hostname = "10.0.0.2";
|
2023-09-05 15:46:26 +00:00
|
|
|
user = "root";
|
2023-04-21 09:20:23 +00:00
|
|
|
};
|
|
|
|
|
2023-07-14 17:26:09 +00:00
|
|
|
"gateway.base.test" = {
|
2023-04-21 09:20:23 +00:00
|
|
|
hostname = "10.0.0.3";
|
|
|
|
user = "root";
|
2023-09-05 15:46:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
"monitor.base.test" = {
|
|
|
|
hostname = "10.0.0.4";
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
|
|
|
|
"proxy1.prod.test" = {
|
|
|
|
hostname = "10.0.0.6";
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
|
2023-09-11 11:54:35 +00:00
|
|
|
"proxy2.prod.test" = {
|
|
|
|
hostname = "10.0.0.7";
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
|
2023-09-05 15:46:26 +00:00
|
|
|
"demo1.prod.test" = {
|
|
|
|
hostname = "10.0.0.5";
|
|
|
|
user = "root";
|
2023-04-21 09:20:23 +00:00
|
|
|
};
|
2023-09-11 11:54:35 +00:00
|
|
|
|
2023-09-16 19:49:51 +00:00
|
|
|
"demo2.prod.test" = {
|
|
|
|
hostname = "10.0.0.5";
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
|
2023-09-11 11:54:35 +00:00
|
|
|
"proxy1.test.test" = {
|
|
|
|
hostname = "10.0.0.8";
|
|
|
|
user = "root";
|
|
|
|
};
|
2023-09-12 13:32:50 +00:00
|
|
|
|
|
|
|
"proxy2.test.test" = {
|
|
|
|
hostname = "10.0.0.9";
|
|
|
|
user = "root";
|
|
|
|
};
|
2023-04-21 09:20:23 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|