From 9f43d64f499c400939ed9562dfae1f78c6f7bffc Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Wed, 30 Jul 2025 21:45:17 +0200 Subject: [PATCH] home/modules/captive-browser: linux DHCP command, default option priority let's just hardcode dhcpcd under Linux. untested. --- home/modules/captive-browser.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/modules/captive-browser.nix b/home/modules/captive-browser.nix index b07be4c..f3c8453 100644 --- a/home/modules/captive-browser.nix +++ b/home/modules/captive-browser.nix @@ -56,11 +56,15 @@ in config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; - programs.captive-browser.settings = { + programs.captive-browser.settings = builtins.mapAttrs (_: lib.mkOptionDefault) { # dhcp-dns is the shell (/bin/sh) command executed to obtain the DHCP # DNS server address. The first match of an IPv4 regex is used. # IPv4 only, because let's be real, it's a captive portal. - dhcp-dns = "ipconfig getoption ${cfg.interface} domain_name_server"; + dhcp-dns = + if isDarwin then + "ipconfig getoption ${cfg.interface} domain_name_server" + else + "${lib.getExe pkgs.dhcpcd} -U ${cfg.interface} | grep domain_name_servers"; # socks5-addr is the listen address for the SOCKS5 proxy server. socks5-addr = "localhost:1666";