2 Commits

Author SHA1 Message Date
f6bd56d583 [fanny] setup initrd wireguard
All checks were successful
Check flake syntax / flake-check (push) Successful in 9m48s
2025-11-15 13:12:29 +01:00
f8f68df868 [initssh] load all zfs keys 2025-11-15 13:12:29 +01:00
3 changed files with 38 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
{ inputs, config, ... }:
let
sshKeys = import ../ssh_keys.nix;
peers = import ../modules/malobeo/peers.nix;
in
{
sops.defaultSopsFile = ./secrets.yaml;
@@ -87,6 +88,33 @@ in
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 = {
enable = true;
name = "fanny";

View File

@@ -56,7 +56,7 @@ in
path = with pkgs; [ zfs ];
serviceConfig.Type = "oneshot";
script = ''
echo "systemctl default" >> /var/empty/.profile
echo "zfs load-key -a; killall zfs; systemctl default" >> /var/empty/.profile
'';
};
};

View File

@@ -44,6 +44,14 @@
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
};
"fanny-initrd" = {
role = "client";
address = "10.100.0.102";
allowedIPs = [ "10.100.0.102/32" ];
#TODO: UPDATE
publicKey = "3U59F6T1s/1LaZBIa6wB0qsVuO6pRR9jfYZJIH2piAU=";
};
"backup0" = {
role = "client";
address = "10.100.0.20";