aboutsummaryrefslogtreecommitdiff
path: root/machines/nixos/x86_64-linux/rivendell
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-10-18 10:58:27 -0700
committerFranck Cuny <franck@fcuny.net>2025-10-18 10:58:27 -0700
commit3676f44fe813794b0603dbc82da3149db8fb4e1c (patch)
tree842d4e799c33a07bd20062c9cac096dd02f1f8ff /machines/nixos/x86_64-linux/rivendell
parentmove the disk configuration for rivendell as a profile (diff)
downloadinfra-3676f44fe813794b0603dbc82da3149db8fb4e1c.tar.gz
configure wireguard for rivendell
Diffstat (limited to 'machines/nixos/x86_64-linux/rivendell')
-rw-r--r--machines/nixos/x86_64-linux/rivendell/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/machines/nixos/x86_64-linux/rivendell/default.nix b/machines/nixos/x86_64-linux/rivendell/default.nix
index 700a57f..1f38f6f 100644
--- a/machines/nixos/x86_64-linux/rivendell/default.nix
+++ b/machines/nixos/x86_64-linux/rivendell/default.nix
@@ -12,6 +12,14 @@
../../../../profiles/disk/btrfs-on-luks.nix
];
+ age = {
+ secrets = {
+ wireguard = {
+ file = ../../../../secrets/rivendell/wireguard.age;
+ };
+ };
+ };
+
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
@@ -45,6 +53,26 @@
nix.settings.trusted-users = [ "builder" ];
+ networking.wireguard = {
+ enable = true;
+ interfaces.wg0 = {
+ ips = [ "10.100.0.60/32" ];
+ listenPort = 51871;
+ privateKeyFile = config.age.secrets.wireguard.path;
+ peers = [
+ {
+ # digital ocean droplet
+ publicKey = "I+l/sWtfXcdunz2nZ05rlDexGew30ZuDxL0DVTTK318=";
+ allowedIPs = [ "10.100.0.0/24" ];
+ endpoint = "165.232.158.110:51871";
+ persistentKeepalive = 25;
+ }
+ ];
+ };
+ };
+
+ networking.firewall.allowedUDPPorts = [ 51871 ];
+
my.modules.hardware.baremetal.enable = true;
my.modules.remote-unlock.enable = true;