diff options
| author | Grigory Shipunov | 2023-05-15 16:50:29 +0200 |
|---|---|---|
| committer | Grigory Shipunov | 2023-05-15 16:50:29 +0200 |
| commit | 1ea959ffb66c8e27f9f6e48060023fa07db865af (patch) | |
| tree | c02e45c1b40839f0db4852edb4de8aa85c1c8203 /microvms/news/oxaproxy.nix | |
| parent | 2809a7e118b8273e2b656222f1d76c08824dcc14 (diff) | |
add news
Diffstat (limited to 'microvms/news/oxaproxy.nix')
| -rw-r--r-- | microvms/news/oxaproxy.nix | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/microvms/news/oxaproxy.nix b/microvms/news/oxaproxy.nix new file mode 100644 index 0000000..451bb53 --- /dev/null +++ b/microvms/news/oxaproxy.nix @@ -0,0 +1,68 @@ +{ config, ... }: { + + networking.wireguard.enable = true; + networking.useNetworkd = true; + + #oxaproxy secret + sops.defaultSopsFile = ../../secrets/news/secrets.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + + sops.secrets."oxaproxy-seckey" = { + owner = config.users.users.systemd-network.name; + }; + + systemd.network = { + enable = true; + netdevs."10-oxaproxy" = { + netdevConfig = { + Kind = "wireguard"; + Name = "oxaproxy"; + Description = "oxa's enterprise reverse-proxy network"; + }; + wireguardConfig = { + PrivateKeyFile = config.sops.secrets."oxaproxy-seckey".path; + #own pubkey: guzNmsPcQw4EGSLU3X0SP+WPKAcoMc+xv9SLWdHV1V0= + }; + wireguardPeers = [ + { + # cirrus + wireguardPeerConfig = { + PublicKey = "0KMtL2fQOrrCH6c2a2l4FKiM73G86sUuyaNj4FarzVM="; + AllowedIPs = [ "10.34.45.0/24" ]; + Endpoint = [ "95.216.166.21:51821" ]; + PersistentKeepalive = 25; + }; + } + ]; + }; + networks."10-oxaproxy" = { + matchConfig.Name = "oxaproxy"; + networkConfig = { + Address = "10.34.45.102/24"; + }; + }; + + networks."111-host" = { + matchConfig.Name = "enp0s8"; + networkConfig = { + Address = "10.99.99.102/24"; + }; + routes = [ + { + routeConfig = { + Gateway = "10.99.99.1"; + Destination = "0.0.0.0/0"; + Metric = 1024; + }; + } + { + routeConfig = { + Gateway = "10.99.99.1"; + Destination = "10.99.99.0/24"; + Metric = 1024; + }; + } + ]; + }; + }; +} |
