From 6934333e13abeed73319c63eb681784d2af3e0b7 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 20 Jan 2025 12:22:05 +0100 Subject: [PATCH] komashi: fix up cellular and misc config~ --- nixos/hosts/komashi/cellular.nix | 23 +++++++++++++++++++++++ wezterm/wezterm.lua | 1 + 2 files changed, 24 insertions(+) diff --git a/nixos/hosts/komashi/cellular.nix b/nixos/hosts/komashi/cellular.nix index 70736c7..0e997e3 100644 --- a/nixos/hosts/komashi/cellular.nix +++ b/nixos/hosts/komashi/cellular.nix @@ -6,6 +6,7 @@ { pkgs, deprekages, + config, ... }: { @@ -135,6 +136,28 @@ # Let anyone execute this. mode = "555"; }; + + # Work properly with KPN's 4-over-6 IP-wonk. + services.clatd = { + enable = true; + settings = { + ip6tables-enable = true; + v4-conncheck-delay = 1; + }; + }; + networking.networkmanager.dispatcherScripts = [{ + source = pkgs.writeShellScript "magic" '' + if [[ "$DEVICE_IFACE" == wwan* ]]; then + if [[ "$NM_DISPATCHER_ACTION" == "up" ]]; then + printf '[Service]\nExecStart=\nExecStart=${config.systemd.services.clatd.serviceConfig.ExecStart} dns64-servers=%s' "$(printf "%s" "$IP6_NAMESERVERS" | ${pkgs.coreutils}/bin/tr ' ' ',')" | ${pkgs.systemd}/bin/systemctl edit --stdin clatd.service --runtime + ${pkgs.systemd}/bin/systemctl restart clatd + fi + if [[ "$NM_DISPATCHER_ACTION" == "down" ]]; then + ${pkgs.systemd}/bin/systemctl restart clatd + fi + fi + ''; + }]; }; } diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index cfdf68f..809b9b1 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -213,6 +213,7 @@ font_overrides = { trailblazer = 11, kanbaru = 12, aigis = 12; + komashi = 12; } if font_overrides[hostname] ~= nil then