moved ap to module

This commit is contained in:
bogale 2026-11-10 12:02:34 +09:00
commit e793066e9b
11 changed files with 61 additions and 64 deletions

43
server/mods/ap.nix Normal file
View 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";
};
};
}

View file

@ -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