Compare commits
2 Commits
38e4199e94
...
f6bd56d583
| Author | SHA1 | Date | |
|---|---|---|---|
| f6bd56d583 | |||
| f8f68df868 |
@@ -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";
|
||||
|
||||
@@ -56,11 +56,11 @@ 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
kernelParams = [ "ip=::::${hostName}-initrd::dhcp" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user