moved ap to module
This commit is contained in:
parent
58ce5e8a6c
commit
d547d2f567
4 changed files with 53 additions and 49 deletions
|
|
@ -1,13 +1,19 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ 2049 ];
|
allowedTCPPorts = [
|
||||||
|
2049
|
||||||
|
53
|
||||||
|
];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
|
53
|
||||||
547
|
547
|
||||||
|
67
|
||||||
69
|
69
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nat = {
|
nat = {
|
||||||
|
enable = true;
|
||||||
enableIPv6 = true;
|
enableIPv6 = true;
|
||||||
internalInterfaces = [ "br0" ];
|
internalInterfaces = [ "br0" ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,22 +16,9 @@
|
||||||
./vps-init.nix
|
./vps-init.nix
|
||||||
];
|
];
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
|
||||||
allowedTCPPorts = [ 53 ];
|
|
||||||
allowedUDPPorts = [
|
|
||||||
53
|
|
||||||
67
|
|
||||||
];
|
|
||||||
};
|
|
||||||
nat.enable = true;
|
|
||||||
networkmanager.ensureProfiles = {
|
networkmanager.ensureProfiles = {
|
||||||
environmentFiles = [ config.sops.secrets.wifi-env.path ];
|
environmentFiles = [ config.sops.secrets.wifi-env.path ];
|
||||||
profiles = {
|
profiles.home-wifi = {
|
||||||
dhcp-ethernet.connection = {
|
|
||||||
id = "dhcp-ethernet";
|
|
||||||
type = "ethernet";
|
|
||||||
};
|
|
||||||
home-wifi = {
|
|
||||||
connection = {
|
connection = {
|
||||||
id = "home-wifi";
|
id = "home-wifi";
|
||||||
type = "wifi";
|
type = "wifi";
|
||||||
|
|
@ -44,7 +31,6 @@
|
||||||
wifi.ssid = "bogale_5";
|
wifi.ssid = "bogale_5";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
wg-quick.interfaces.awg0.type = "amneziawg";
|
wg-quick.interfaces.awg0.type = "amneziawg";
|
||||||
};
|
};
|
||||||
sops = {
|
sops = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
{ config, pkgs, ... }: {
|
{ config, ... }: {
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "consoleblank=60" ];
|
||||||
"cfg80211.ieee80211_regdom=RU"
|
|
||||||
"consoleblank=60"
|
|
||||||
];
|
|
||||||
imports = [
|
imports = [
|
||||||
../mods/host.nix
|
../mods/host.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
|
|
@ -22,26 +19,9 @@
|
||||||
allowedUDPPorts = [ 443 ];
|
allowedUDPPorts = [ 443 ];
|
||||||
};
|
};
|
||||||
hostName = "nixos-server";
|
hostName = "nixos-server";
|
||||||
nat.internalInterfaces = [ "wlp2s0" ];
|
networkmanager.ensureProfiles.profiles.dhcp-ethernet.connection = {
|
||||||
networkmanager.ensureProfiles.profiles = {
|
id = "dhcp-ethernet";
|
||||||
dhcp-ethernet.ethernet.cloned-mac-address = "0C:0E:76:A6:E6:B6";
|
type = "ethernet";
|
||||||
home-wifi = {
|
|
||||||
ipv4 = {
|
|
||||||
addresses = "10.1.0.1/16";
|
|
||||||
method = "shared";
|
|
||||||
};
|
|
||||||
wifi = {
|
|
||||||
band = "a";
|
|
||||||
channel = 157;
|
|
||||||
channel-width = 80;
|
|
||||||
mode = "ap";
|
|
||||||
};
|
|
||||||
wifi-security = {
|
|
||||||
group = "ccmp";
|
|
||||||
pairwise = "ccmp";
|
|
||||||
proto = "rsn";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path;
|
wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
32
server/mods/ap.nix
Normal file
32
server/mods/ap.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
boot.kernelParams = [ "cfg80211.ieee80211_regdom=RU" ];
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [ 53 ];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
53
|
||||||
|
67
|
||||||
|
];
|
||||||
|
};
|
||||||
|
networkmanager.ensureProfiles.profiles = {
|
||||||
|
dhcp-ethernet.ethernet.cloned-mac-address = "0C:0E:76:A6:E6:B6";
|
||||||
|
home-wifi = {
|
||||||
|
ipv4 = {
|
||||||
|
addresses = "10.1.0.1/16";
|
||||||
|
method = "shared";
|
||||||
|
};
|
||||||
|
wifi = {
|
||||||
|
band = "a";
|
||||||
|
channel = 157;
|
||||||
|
channel-width = 80;
|
||||||
|
mode = "ap";
|
||||||
|
};
|
||||||
|
wifi-security = {
|
||||||
|
group = "ccmp";
|
||||||
|
pairwise = "ccmp";
|
||||||
|
proto = "rsn";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue