moved ap to module

This commit is contained in:
bogale 2026-11-08 21:25:43 +09:00
commit 10a4ae7c36
8 changed files with 56 additions and 61 deletions

View file

@ -48,13 +48,6 @@
passwordlessSyncUsers = [ "bogale" ];
settings.cursor.size = 24;
};
greetd = {
enable = true;
settings.default_session = {
command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session";
user = "greeter";
};
};
logind.settings.Login.HandleLidSwitch = "suspend-then-hibernate";
pipewire = {
enable = true;

View file

@ -4,10 +4,12 @@
allowedTCPPorts = [ 2049 ];
allowedUDPPorts = [
547
67
69
];
};
nat = {
enable = true;
enableIPv6 = true;
internalInterfaces = [ "br0" ];
};

18
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1793193205,
"narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=",
"lastModified": 1793979366,
"narHash": "sha256-7OoWDsYO9teiPxl0QdlS5lYE20Pue8/5mpscSL32FUA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34",
"rev": "2c0c1f01521469cf0271180c453c79782d53c2f6",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1793110635,
"narHash": "sha256-dhoW6VgFWlaodSY5jrBn+CF2FLmaUvDVgM7+C7T2+NM=",
"lastModified": 1793876309,
"narHash": "sha256-Wojg9lIH/hDH91iDVH2/EPw8oDSpxjxhXONbU1yf4Zg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "31ecbaca1bdefa45dffc409f0250bd8039ea0010",
"rev": "f9a75f41be3a74eab55d3a7679d34ad6cc0da977",
"type": "github"
},
"original": {
@ -50,11 +50,11 @@
]
},
"locked": {
"lastModified": 1793052255,
"narHash": "sha256-Y/JIHTnMlOabDfyaSBubWGLDIVGihLEUuoMhFvQKaDo=",
"lastModified": 1793995029,
"narHash": "sha256-ZlE4BtMjWhfC6rFXLO9Qimn36Ene1INqCgKDDvazjhc=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "60182817ee048ac94b4c68ea76d5ef2e8aac730d",
"rev": "89a234ce2daf6e568a7d4b4fe250afdd23d84e20",
"type": "github"
},
"original": {

View file

@ -16,14 +16,6 @@
./vps-init.nix
];
networking = {
firewall = {
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [
53
67
];
};
nat.enable = true;
networkmanager.ensureProfiles = {
environmentFiles = [ config.sops.secrets.wifi-env.path ];
profiles = {

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }: {
boot.kernelParams = [
"cfg80211.ieee80211_regdom=RU"
"consoleblank=60"
];
{ config, ... }: {
boot.kernelParams = [ "consoleblank=60" ];
imports = [
../mods/host.nix
./hardware.nix
@ -22,27 +19,6 @@
allowedUDPPorts = [ 443 ];
};
hostName = "nixos-server";
nat.internalInterfaces = [ "wlp2s0" ];
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";
};
};
};
wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path;
};
security.acme = {

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