nixos/kelder: Switch to AirVPN

This commit is contained in:
Jack O'Sullivan 2023-09-07 00:05:30 +01:00
parent d84330d67c
commit 4e16ffaa17
4 changed files with 46 additions and 24 deletions

View File

@ -4,23 +4,30 @@ let
inherit (lib.my) networkdAssignment; inherit (lib.my) networkdAssignment;
wg = { wg = {
keyFile = "kelder/acquisition/mullvad-privkey"; keyFile = "kelder/acquisition/airvpn-privkey";
pskFile = "kelder/acquisition/airvpn-psk";
fwMark = 42; fwMark = 42;
routeTable = 51820; routeTable = 51820;
}; };
# Forwarded in Mullvad config # Forwarded in AirVPN config
transmissionPeerPort = 56630; transmissionPeerPort = 26180;
in in
{ {
config = mkMerge [ config = mkMerge [
{ {
my = { my = {
secrets = { secrets = {
files."${wg.keyFile}" = { files = {
"${wg.keyFile}" = {
group = "systemd-network"; group = "systemd-network";
mode = "440"; mode = "440";
}; };
"${wg.pskFile}" = {
group = "systemd-network";
mode = "440";
};
};
}; };
firewall = { firewall = {
@ -56,6 +63,8 @@ in
netdevConfig = { netdevConfig = {
Name = "vpn"; Name = "vpn";
Kind = "wireguard"; Kind = "wireguard";
# Specified by AirVPN
MTUBytes = "1320";
}; };
wireguardConfig = { wireguardConfig = {
PrivateKeyFile = config.age.secrets."${keyFile}".path; PrivateKeyFile = config.age.secrets."${keyFile}".path;
@ -64,10 +73,11 @@ in
}; };
wireguardPeers = [ wireguardPeers = [
{ {
# mlvd-ie-dub-wg-101 # AirVPN IE
wireguardPeerConfig = { wireguardPeerConfig = {
Endpoint = "146.70.189.2:51820"; Endpoint = "146.70.94.2:1637";
PublicKey = "lHrukA9+vn7Jjzx2Nb/1NQ0WiaiKppEqVxrGT5X1RFQ="; PublicKey = "PyLCXAQT8KkM4T+dUsOQfn+Ub3pGxfGlxkIApuig+hk=";
PresharedKeyFile = config.age.secrets."${pskFile}".path;
AllowedIPs = [ "0.0.0.0/0" "::/0" ]; AllowedIPs = [ "0.0.0.0/0" "::/0" ];
}; };
} }
@ -83,8 +93,8 @@ in
]; ];
"90-vpn" = with wg; { "90-vpn" = with wg; {
matchConfig.Name = "vpn"; matchConfig.Name = "vpn";
address = [ "10.66.242.99/32" "fc00:bbbb:bbbb:bb01::3:f262/128" ]; address = [ "10.161.170.28/32" "fd7d:76ee:e68f:a993:b12d:6d15:c80a:9516/128" ];
dns = [ "10.64.0.1" ]; dns = [ "10.128.0.1" "fd7d:76ee:e68f:a993::1" ];
routingPolicyRules = map (r: { routingPolicyRuleConfig = r; }) [ routingPolicyRules = map (r: { routingPolicyRuleConfig = r; }) [
{ {
Family = "both"; Family = "both";

View File

@ -0,0 +1,13 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IDdXUTlQQSB4NWhG
VTZNTFEyQ3oybkZqSUxGenBwdDBmVHNMTmlXMEZ3b2ZiKzdhUDI4ClhNMzAyNHdx
YnZhRlRwUVpkMHRJMkxVeFJ4MGwxamRjNW0ySzVjc2thdWMKLT4gWDI1NTE5IHk2
dng5VEM2amRpMThlREk0dy9QTlRKRVIvVkN2YWx0SG54UWp4R0hFejQKanRlYmxP
NVVtYXJxdVFsdzJhM2lvU09kWElmS1psM3VYQzhrMkpZK3RKcwotPiBsOy1ncmVh
c2UgRDNvSiFGIHVjK19PMSwsIGwKbDM4UE5HNkl1c0tQM0JHOG1EaWRFNUZhYlg5
NE5PSTl3K1NQRW5VeWYzNVV0OXd1TmpRK21sbzN5VUZHYzZhWgpVemJMTE80M2p0
NmM1SjQ0UCtHa1ArbVhkWis2NTc1YmJHcGN1eURFWkFxbWhHdEJvSkFBCi0tLSA0
N29PNTlYOUpza0FxNmpKRTUwNTJWSGNtMUI1Y2dVQW5xeWFVZFdHMmFNCvME06Jn
IcrlscKEzgADVR4uS9C8WQrcclw6EO3abNqKrYYcjG8zm0HgoxXY3D5VIsSjISGP
lR5AfhtwYJlTk2mbpESqa+Dgn6M4jodm
-----END AGE ENCRYPTED FILE-----

View File

@ -0,0 +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