mirror of
https://github.com/elitak/nixos-infect
synced 2024-11-10 05:54:20 +00:00
nameserver parsing fix
This commit is contained in:
parent
10e8dfe80a
commit
1f4ca1ba1a
1 changed files with 2 additions and 7 deletions
|
@ -84,10 +84,7 @@ EOF
|
||||||
extraRules1=""
|
extraRules1=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nameservers=()
|
readarray nameservers < <(grep ^nameserver /etc/resolv.conf | sed -r 's/^nameserver[[:space:]]+([0-9.a-fA-F]+).*/"\1"/')
|
||||||
while IFS='' read -r line; do
|
|
||||||
nameservers+=("$line")
|
|
||||||
done < <(grep ^nameserver /etc/resolv.conf | cut -f2 -d' ')
|
|
||||||
|
|
||||||
if [[ "$eth0_name" = eth* ]]; then
|
if [[ "$eth0_name" = eth* ]]; then
|
||||||
predictable_inames="usePredictableInterfaceNames = lib.mkForce false;"
|
predictable_inames="usePredictableInterfaceNames = lib.mkForce false;"
|
||||||
|
@ -99,9 +96,7 @@ EOF
|
||||||
# This file was populated at runtime with the networking
|
# This file was populated at runtime with the networking
|
||||||
# details gathered from the active system.
|
# details gathered from the active system.
|
||||||
networking = {
|
networking = {
|
||||||
nameservers = [$(for a in "${nameservers[@]}"; do echo -n "
|
nameservers = [ ${nameservers[@]} ];
|
||||||
$a"; done)
|
|
||||||
];
|
|
||||||
defaultGateway = "${gateway}";
|
defaultGateway = "${gateway}";
|
||||||
defaultGateway6 = "${gateway6}";
|
defaultGateway6 = "${gateway6}";
|
||||||
dhcpcd.enable = false;
|
dhcpcd.enable = false;
|
||||||
|
|
Loading…
Reference in a new issue