BIG changes. Make almost every server service modular, to distribute among multiple servers
This commit is contained in:
parent
30fc0dc800
commit
7e40fd4fb3
44 changed files with 153 additions and 143 deletions
|
@ -3,7 +3,6 @@
|
|||
imports = [
|
||||
./ips
|
||||
./wireless
|
||||
./wireguard
|
||||
];
|
||||
|
||||
networking = {
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.system.wireguard.client.enable = lib.mkEnableOption "Enable the Wireguard client";
|
||||
|
||||
config = lib.mkIf config.system.wireguard.client.enable {
|
||||
networking = {
|
||||
firewall.trustedInterfaces = [ "wgc" ];
|
||||
wg-quick.interfaces.wgc = {
|
||||
privateKey = config.secrets.wg.clientKey;
|
||||
peers = [
|
||||
{ # Kitty server
|
||||
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
endpoint = "sv.nixfox.ca:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./client
|
||||
./server
|
||||
];
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.system.wireguard.server.enable = lib.mkEnableOption "Enable the Wireguard server";
|
||||
|
||||
config = lib.mkIf config.system.wireguard.server.enable {
|
||||
networking = {
|
||||
firewall.allowedUDPPorts = [ 51820 ];
|
||||
|
||||
nat = {
|
||||
enable = config.system.wireguard.server.enable;
|
||||
internalInterfaces = [ "wgs" ];
|
||||
};
|
||||
|
||||
wireguard.interfaces.wgs = {
|
||||
ips = [ "10.100.0.1/24" ];
|
||||
listenPort = 51820;
|
||||
privateKey = config.secrets.wg.serverKey;
|
||||
peers = [
|
||||
{ # NixOS Config Key
|
||||
publicKey = "OKUH/h6YSURI4vgeTZKQD15QsqaygdbTn1mAWzQp9S0=";
|
||||
allowedIPs = [ "10.100.0.16/28" ];
|
||||
}
|
||||
{ # Pixel 9
|
||||
publicKey = "dPCtjm67adMZCnyL1O2L+uUOk0RbjA9T/tht1r+qcE4=";
|
||||
allowedIPs = [ "10.100.0.2/32" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue