MyNixOS website logo
option

networking.wireless.environmentFile

File consisting of lines of the form varname=value to define variables for the wireless configuration.

See section "EnvironmentFile=" in systemd.exec(5) for a syntax reference.

Secrets (PSKs, passwords, etc.) can be provided without adding them to the world-readable Nix store by defining them in the environment file and referring to them in option networking.wireless.networks with the syntax @varname@. Example:

# content of /run/secrets/wireless.env
PSK_HOME=mypassword
PASS_WORK=myworkpassword
# wireless-related configuration
networking.wireless.environmentFile = "/run/secrets/wireless.env";
networking.wireless.networks = {
  home.psk = "@PSK_HOME@";
  work.auth = ''
    eap=PEAP
    identity="[email protected]"
    password="@PASS_WORK@"
  '';
};
Declarations
Type
null or path
Default
null
Example
"/run/secrets/wireless.env"