moved ap to module
This commit is contained in:
parent
58ce5e8a6c
commit
10a4ae7c36
8 changed files with 56 additions and 61 deletions
|
|
@ -48,13 +48,6 @@
|
||||||
passwordlessSyncUsers = [ "bogale" ];
|
passwordlessSyncUsers = [ "bogale" ];
|
||||||
settings.cursor.size = 24;
|
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";
|
logind.settings.Login.HandleLidSwitch = "suspend-then-hibernate";
|
||||||
pipewire = {
|
pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,12 @@
|
||||||
allowedTCPPorts = [ 2049 ];
|
allowedTCPPorts = [ 2049 ];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
547
|
547
|
||||||
|
67
|
||||||
69
|
69
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nat = {
|
nat = {
|
||||||
|
enable = true;
|
||||||
enableIPv6 = true;
|
enableIPv6 = true;
|
||||||
internalInterfaces = [ "br0" ];
|
internalInterfaces = [ "br0" ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1793193205,
|
"lastModified": 1793979366,
|
||||||
"narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=",
|
"narHash": "sha256-7OoWDsYO9teiPxl0QdlS5lYE20Pue8/5mpscSL32FUA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34",
|
"rev": "2c0c1f01521469cf0271180c453c79782d53c2f6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -22,11 +22,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1793110635,
|
"lastModified": 1793876309,
|
||||||
"narHash": "sha256-dhoW6VgFWlaodSY5jrBn+CF2FLmaUvDVgM7+C7T2+NM=",
|
"narHash": "sha256-Wojg9lIH/hDH91iDVH2/EPw8oDSpxjxhXONbU1yf4Zg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "31ecbaca1bdefa45dffc409f0250bd8039ea0010",
|
"rev": "f9a75f41be3a74eab55d3a7679d34ad6cc0da977",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -50,11 +50,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1793052255,
|
"lastModified": 1793995029,
|
||||||
"narHash": "sha256-Y/JIHTnMlOabDfyaSBubWGLDIVGihLEUuoMhFvQKaDo=",
|
"narHash": "sha256-ZlE4BtMjWhfC6rFXLO9Qimn36Ene1INqCgKDDvazjhc=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "60182817ee048ac94b4c68ea76d5ef2e8aac730d",
|
"rev": "89a234ce2daf6e568a7d4b4fe250afdd23d84e20",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,6 @@
|
||||||
./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 = {
|
||||||
|
|
|
||||||
|
|
@ -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,27 +19,6 @@
|
||||||
allowedUDPPorts = [ 443 ];
|
allowedUDPPorts = [ 443 ];
|
||||||
};
|
};
|
||||||
hostName = "nixos-server";
|
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;
|
wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path;
|
||||||
};
|
};
|
||||||
security.acme = {
|
security.acme = {
|
||||||
|
|
|
||||||
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 = { };
|
sops.secrets.tgbot-env = { };
|
||||||
systemd = {
|
systemd = {
|
||||||
services = {
|
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 = {
|
network-watchdog = {
|
||||||
path = with pkgs; [
|
path = with pkgs; [
|
||||||
curl
|
curl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue