-
Notifications
You must be signed in to change notification settings - Fork 13
/
nas-wifi.nix
41 lines (41 loc) · 868 Bytes
/
nas-wifi.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
let
secrets = import ./load-secrets.nix;
WIFI = "wlan0";
in {
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = true;
};
networking = {
interfaces = {
${WIFI} = {
ipv4.addresses = [
{
address = "192.168.3.1";
prefixLength = 24;
}
];
};
};
};
services = {
hostapd = {
enable = true;
interface = WIFI;
ssid = "Family-nas";
wpaPassphrase = secrets.wifiPassword;
};
dhcpd4 = {
enable = true;
interfaces = [ WIFI ];
extraConfig = ''
authoritative;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.1;
option broadcast-address 192.168.3.255;
option domain-name-servers 192.168.2.1;
range 192.168.3.100 192.168.3.200;
}
'';
};
};
}