0

What is the configuration I would use to enable my wireless adapter WITHOUT having any X Server/Desktop installed. The install is simply a terminal install. Also I want to specify a static IP address for the machine. If someone could share the nixos configuration to achieve that, it would be appreciated.

ftravers
  • 3,809
  • 3
  • 37
  • 38
  • try reading [this](https://nixos.org/nixos/manual/index.html#sec-wireless) for wireless and [this](https://nixos.org/nixos/manual/index.html#sec-ipv4) for IP. Sorry for not writing a full answer. I don't have any wireless notebook to try right now. – wizzup Oct 09 '17 at 12:25
  • 1
    Did you try enabling `networking.networkmanager.enable` and using the `nmtui` client? – Robert Hensing Oct 09 '17 at 18:21

1 Answers1

3

This code will do it:

  networking = {
    interfaces.wlp1s0.ip4 = [ { address = "192.168.0.150"; prefixLength = 24; } ];
    defaultGateway = "192.168.0.1";
    nameservers = [ "8.8.8.8" ];

    wireless = {
      enable = true;
      interfaces = ["wlp1s0"];
      userControlled.enable = true;
      userControlled.group = "wheel";
      networks = {
        "1529-upstairs-2.4" = {
          psk = "abc7654321";
        };
      };
    };

    hostName = "delldesk"; 
  };

 environment.systemPackages = with pkgs; [
   dhcpcd wpa_supplicant
 ];

my wireless device is: wlp1s0.

I have a network called: 1529-upstairs-2.4

The password to that WIFI is: abc7654321

ftravers
  • 3,809
  • 3
  • 37
  • 38