moved ap to module
This commit is contained in:
parent
58ce5e8a6c
commit
2b2338a0da
6 changed files with 47 additions and 52 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" ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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