From ed3b15a39671fab32891ae0579ff46841be60d25 Mon Sep 17 00:00:00 2001 From: Peter Rice Date: Sun, 23 Aug 2026 23:28:52 -0400 Subject: [PATCH] hack: override router ip when not on lan --- modules/flake/router.nix | 3 +++ modules/hosts/crossbell/default.nix | 2 ++ modules/nixos/yggdrasil/hosts.nix | 1 + 3 files changed, 6 insertions(+) diff --git a/modules/flake/router.nix b/modules/flake/router.nix index 4b1d74f..6bd4175 100644 --- a/modules/flake/router.nix +++ b/modules/flake/router.nix @@ -13,6 +13,9 @@ in default = "ygg.pvsr.dev"; readOnly = true; }; + ip = lib.mkOption { + type = lib.types.str; + }; hosts = lib.mkOption { type = lib.types.attrsOf lib.types.str; }; diff --git a/modules/hosts/crossbell/default.nix b/modules/hosts/crossbell/default.nix index 1a7df1d..71087a7 100644 --- a/modules/hosts/crossbell/default.nix +++ b/modules/hosts/crossbell/default.nix @@ -49,6 +49,8 @@ in t.assertEqual("308->https://pvsr.dev/", result) ''; + networking.nameservers = lib.mkForce [ router.ip ]; + services.openssh.listenAddresses = [ { addr = "0.0.0.0"; diff --git a/modules/nixos/yggdrasil/hosts.nix b/modules/nixos/yggdrasil/hosts.nix index f3a3a24..bd206b4 100644 --- a/modules/nixos/yggdrasil/hosts.nix +++ b/modules/nixos/yggdrasil/hosts.nix @@ -41,6 +41,7 @@ in flake.modules.nixos.yggdrasilGateway.services.yggdrasil.settings.AllowedPublicKeys = map (builtins.getAttr "publicKey") (builtins.attrValues hosts); + router.ip = hosts.router.address; router.hosts = hosts |> lib.filterAttrs (_: host: host ? "address") |> builtins.mapAttrs (_: host: host.address); -- 2.51.2