moved ap to module
This commit is contained in:
parent
58ce5e8a6c
commit
10a4ae7c36
8 changed files with 56 additions and 61 deletions
43
server/mods/ap.nix
Normal file
43
server/mods/ap.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.services.hotspot-routing = {
|
||||
after = [ "wg-quick-awg0.service" ];
|
||||
path = [ pkgs.iproute2 ];
|
||||
preStop = "ip rule del from 10.1.0.0/16 lookup main";
|
||||
requiredBy = [ "wg-quick-awg0.service" ];
|
||||
script = "ip rule add from 10.1.0.0/16 lookup main";
|
||||
serviceConfig = {
|
||||
RemainAfterExit = true;
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -18,17 +18,6 @@
|
|||
sops.secrets.tgbot-env = { };
|
||||
systemd = {
|
||||
services = {
|
||||
hotspot-routing = {
|
||||
after = [ "wg-quick-awg0.service" ];
|
||||
path = [ pkgs.iproute2 ];
|
||||
preStop = "ip rule del from 10.1.0.0/16 lookup main";
|
||||
requiredBy = [ "wg-quick-awg0.service" ];
|
||||
script = "ip rule add from 10.1.0.0/16 lookup main";
|
||||
serviceConfig = {
|
||||
RemainAfterExit = true;
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
network-watchdog = {
|
||||
path = with pkgs; [
|
||||
curl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue