nixos/wireless: fix failure on missing config file
This change prevents doing the secret substitution when the config is missing, which would result in an error. The service can be useful even without configuration; for example connman controls wpa_supplicant using dbus and as such it does not need a config file nor any other declarative options.
This commit is contained in:
parent
6fe6edbd8a
commit
688d658a96
1 changed files with 9 additions and 5 deletions
|
@ -121,11 +121,15 @@ let
|
|||
''}
|
||||
|
||||
# substitute environment variables
|
||||
if [ -f "${configFile}" ]; then
|
||||
${pkgs.gawk}/bin/awk '{
|
||||
for(varname in ENVIRON)
|
||||
gsub("@"varname"@", ENVIRON[varname])
|
||||
print
|
||||
}' "${configFile}" > "${finalConfig}"
|
||||
else
|
||||
touch "${finalConfig}"
|
||||
fi
|
||||
|
||||
iface_args="-s ${optionalString cfg.dbusControlled "-u"} -D${cfg.driver} ${configStr}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue