在nixos上启用无线,无X.

时间:2017-10-08 17:09:15

标签: nixos

我将使用什么配置来启用我的无线适配器而不安装任何X Server / Desktop。安装只是一个终端安装。另外,我想为机器指定静态IP地址。如果有人可以分享nixos配置来实现这一点,那将不胜感激。

1 个答案:

答案 0 :(得分:1)

此代码将执行此操作:

  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
 ];

我的无线设备是:wlp1s0

我有一个名为1529-upstairs-2.4

的网络

该WIFI的密码为:abc7654321