[fanny] setup initrd wireguard
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m48s
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m48s
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{ inputs, config, ... }:
|
{ inputs, config, ... }:
|
||||||
let
|
let
|
||||||
sshKeys = import ../ssh_keys.nix;
|
sshKeys = import ../ssh_keys.nix;
|
||||||
|
peers = import ../modules/malobeo/peers.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sops.defaultSopsFile = ./secrets.yaml;
|
sops.defaultSopsFile = ./secrets.yaml;
|
||||||
@@ -87,6 +88,33 @@ in
|
|||||||
ethernetDrivers = ["r8169"];
|
ethernetDrivers = ["r8169"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.initrd = {
|
||||||
|
availableKernelModules = [ "wireguard" ];
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
network = {
|
||||||
|
enable = true;
|
||||||
|
netdevs."30-wg-initrd" = {
|
||||||
|
netdevConfig = {
|
||||||
|
Kind = "wireguard";
|
||||||
|
Name = "wg-initrd";
|
||||||
|
};
|
||||||
|
wireguardConfig = { PrivateKeyFile = "/etc/secrets/30-wg-initrd.key"; };
|
||||||
|
wireguardPeers = [{
|
||||||
|
AllowedIPs = peers.fanny-initrd.allowedIPs;
|
||||||
|
PublicKey = peers.fanny-initrd.publicKey;
|
||||||
|
Endpoint = "${peers.vpn.publicIp}:${builtins.toString(peers.vpn.listenPort)}";
|
||||||
|
PersistentKeepalive = 25;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
networks."30-wg-initrd" = {
|
||||||
|
name = "wg-initrd";
|
||||||
|
addresses = [{ Address = peers.fanny-initrd.address; }];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.malobeo.vpn = {
|
services.malobeo.vpn = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "fanny";
|
name = "fanny";
|
||||||
|
|||||||
@@ -44,6 +44,14 @@
|
|||||||
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
|
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"fanny-initrd" = {
|
||||||
|
role = "client";
|
||||||
|
address = "10.100.0.102";
|
||||||
|
allowedIPs = [ "10.100.0.102/32" ];
|
||||||
|
#TODO: UPDATE
|
||||||
|
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
|
||||||
|
};
|
||||||
|
|
||||||
"backup0" = {
|
"backup0" = {
|
||||||
role = "client";
|
role = "client";
|
||||||
address = "10.100.0.20";
|
address = "10.100.0.20";
|
||||||
|
|||||||
Reference in New Issue
Block a user