[Nix-dev] networking.wlanInterfaces issues
Kirill Elagin
kirelagin at gmail.com
Sun May 28 08:38:03 CEST 2017
On Sat, May 27, 2017 at 10:28 PM Tomas Hlavaty <tom at logand.com> wrote:
> Hi,
>
> I have issues with wifi configuration on 17.03.1203.58e227052d
> (Gorilla):
>
> 1) specifying mac address doesn't work:
>
> building the system configuration...
> error: undefined variable ‘device’ at
> /nix/store/nm3nvlszbsg7c574airhra5gj2xwc9s8-nixexprs.tar.xz/nixos/modules/tasks/network-interfaces.nix:1120:89
> (use ‘--show-trace’ to show detailed location information)
>
> with config like this:
>
> networking.wlanInterfaces = {
> wlan1 = {
> device = "wlan0";
> mac = "12:34:56:78:90:12";
> };
> }
>
> Commenting out the mac line avoids the error but doesn't set the mac
> address.
>
This should help: https://github.com/NixOS/nixpkgs/pull/26170.
> 2) What is wlanInterfaces supposed to do? It does nothing as far as I
> can see. In the example above, I would expect that "ip a" doesn't
> show wlan0 anymore but shows wlan1 instead. Is my expectation
> correct?
>
> 3) How can I set a wireless interface to ad-hoc mode? The device
> supports it, but wlanInterfaces does nothing again:
>
> $ iw list | grep -i ibss\\.
> Device supports RSN-IBSS.
> Device supports HT-IBSS.
>
> networking.wlanInterfaces = {
> wlan1 = {
> type = "ibss";
> device = "wlan0";
> mac = "12:34:56:78:90:12";
> };
> }
>
https://github.com/NixOS/nixpkgs/blob/953616907493c5b81ba3ec9dd86f1422f4d1fcd3/nixos/modules/tasks/network-interfaces.nix#L816
Your wireless card is a “physical” device, on top of it you can create a
number of “virtual” interfaces (e.g. `wlan0`). The `device` attribute
inside `wlanInterfaces` refers to this physical device, not virtual
interface (you need something along the lines of `iw phy`, I can’t remember
exactly, I’m sorry).
> Thanks for ideas.
>
> Tomas
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170528/243f9e71/attachment.html>
More information about the nix-dev
mailing list