From 910f233fb7120c51cb8cbbaed4fab4caa6e5d751 Mon Sep 17 00:00:00 2001 From: Ankit Pandey Date: Sun, 1 Aug 2021 13:40:06 -0500 Subject: [PATCH] captive-browser: fix empty string in interface args Fixes nmcli being passed an empty string before the interface name, which would stop captive-browser from starting up. --- nixos/modules/programs/captive-browser.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/modules/programs/captive-browser.nix b/nixos/modules/programs/captive-browser.nix index 1f223e2475ce..3c52f32f4738 100644 --- a/nixos/modules/programs/captive-browser.nix +++ b/nixos/modules/programs/captive-browser.nix @@ -84,18 +84,18 @@ in programs.captive-browser.dhcp-dns = let - iface = prefix: - optionalString cfg.bindInterface (concatStringsSep " " (map escapeShellArg [ prefix cfg.interface ])); + iface = prefixes: + optionalString cfg.bindInterface (escapeShellArgs (prefixes ++ [ cfg.interface ])); in mkOptionDefault ( if config.networking.networkmanager.enable then - "${pkgs.networkmanager}/bin/nmcli dev show ${iface ""} | ${pkgs.gnugrep}/bin/fgrep IP4.DNS" + "${pkgs.networkmanager}/bin/nmcli dev show ${iface []} | ${pkgs.gnugrep}/bin/fgrep IP4.DNS" else if config.networking.dhcpcd.enable then - "${pkgs.dhcpcd}/bin/dhcpcd ${iface "-U"} | ${pkgs.gnugrep}/bin/fgrep domain_name_servers" + "${pkgs.dhcpcd}/bin/dhcpcd ${iface ["-U"]} | ${pkgs.gnugrep}/bin/fgrep domain_name_servers" else if config.networking.useNetworkd then - "${cfg.package}/bin/systemd-networkd-dns ${iface ""}" + "${cfg.package}/bin/systemd-networkd-dns ${iface []}" else - "${config.security.wrapperDir}/udhcpc --quit --now -f ${iface "-i"} -O dns --script ${ + "${config.security.wrapperDir}/udhcpc --quit --now -f ${iface ["-i"]} -O dns --script ${ pkgs.writeShellScript "udhcp-script" '' if [ "$1" = bound ]; then echo "$dns"