about summary refs log tree commit diff stats
path: root/nix-conf/machines
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-08-30 12:14:21 +0100
committerDavid Morgan <djm_uk@protonmail.com>2024-08-30 12:14:21 +0100
commit97d6fc0c1e0b371f75f8621cde388811c3309159 (patch)
tree52379284e1338ba6442d90225c3ed505af592de0 /nix-conf/machines
parent921200a6490cc87af4e5e1ad955ef3cce75fa3d3 (diff)
downloaddotfiles-97d6fc0c1e0b371f75f8621cde388811c3309159.tar.gz
Emulate sops-nix for edrahil network configuration
Diffstat (limited to 'nix-conf/machines')
-rw-r--r--nix-conf/machines/edrahil/network-configuration.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/nix-conf/machines/edrahil/network-configuration.nix b/nix-conf/machines/edrahil/network-configuration.nix
new file mode 100644
index 0000000..7a1b0b0
--- /dev/null
+++ b/nix-conf/machines/edrahil/network-configuration.nix
@@ -0,0 +1,17 @@
+{ ... }:
+{
+  networking = {
+    interfaces.ens3.ipv6.addresses = [{
+      # Emulate nix-sops. Technically an anti-pattern, but IP addresses aren't real secrets, and this has to be embedded here,
+      # as we cannot set a file path to read it from.
+      # Populate/update with:
+      # doas su -c "SOPS_AGE_KEY=$(doas ssh-to-age -private-key -i /etc/ssh/ssh_host_ed25519_key) `which sops` -d --extract '[\"ipv6_address\"]' secrets/edrahil.yaml > /root/.config/secrets/ipv6_address"
+      address = builtins.readFile "/root/.config/secrets/ipv6_address";
+      prefixLength = 64;
+    }];
+    defaultGateway6 = {
+      address = "fe80::1";
+      interface = "ens3";
+    };
+  };
+}