From 4430f3a1d55d8400217d013c971a442d5266a85e Mon Sep 17 00:00:00 2001 From: bogale Date: Sun, 8 Nov 2026 21:03:53 +0900 Subject: [PATCH] moved ap to module --- desktop/configuration.nix | 7 ------- desktop/mods/pxeboot.nix | 6 +----- mods/host.nix | 24 +++++++++++++++--------- server/configuration.nix | 4 ---- server/mods/ap.nix | 11 +++++++++++ server/mods/system.nix | 11 ----------- 6 files changed, 27 insertions(+), 36 deletions(-) diff --git a/desktop/configuration.nix b/desktop/configuration.nix index 3b93b0d..aa5f649 100644 --- a/desktop/configuration.nix +++ b/desktop/configuration.nix @@ -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; diff --git a/desktop/mods/pxeboot.nix b/desktop/mods/pxeboot.nix index c0de16e..317f751 100644 --- a/desktop/mods/pxeboot.nix +++ b/desktop/mods/pxeboot.nix @@ -1,12 +1,8 @@ { config, pkgs, ... }: { networking = { firewall = { - allowedTCPPorts = [ - 2049 - 53 - ]; + allowedTCPPorts = [ 2049 ]; allowedUDPPorts = [ - 53 547 67 69 diff --git a/mods/host.nix b/mods/host.nix index 10d65e0..65a36d4 100644 --- a/mods/host.nix +++ b/mods/host.nix @@ -18,17 +18,23 @@ networking = { networkmanager.ensureProfiles = { environmentFiles = [ config.sops.secrets.wifi-env.path ]; - profiles.home-wifi = { - connection = { - id = "home-wifi"; - type = "wifi"; + profiles = { + dhcp-ethernet.connection = { + id = "dhcp-ethernet"; + type = "ethernet"; }; - ipv6.method = "disabled"; - wifi-security = { - key-mgmt = "sae"; - psk = "$BOGALE_5_PSK"; + home-wifi = { + connection = { + id = "home-wifi"; + type = "wifi"; + }; + ipv6.method = "disabled"; + wifi-security = { + key-mgmt = "sae"; + psk = "$BOGALE_5_PSK"; + }; + wifi.ssid = "bogale_5"; }; - wifi.ssid = "bogale_5"; }; }; wg-quick.interfaces.awg0.type = "amneziawg"; diff --git a/server/configuration.nix b/server/configuration.nix index 575b715..455b061 100644 --- a/server/configuration.nix +++ b/server/configuration.nix @@ -19,10 +19,6 @@ allowedUDPPorts = [ 443 ]; }; hostName = "nixos-server"; - networkmanager.ensureProfiles.profiles.dhcp-ethernet.connection = { - id = "dhcp-ethernet"; - type = "ethernet"; - }; wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path; }; security.acme = { diff --git a/server/mods/ap.nix b/server/mods/ap.nix index c4ee327..e98544c 100644 --- a/server/mods/ap.nix +++ b/server/mods/ap.nix @@ -29,4 +29,15 @@ }; }; }; + 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"; + }; + }; } diff --git a/server/mods/system.nix b/server/mods/system.nix index 53ca29e..c9889ee 100644 --- a/server/mods/system.nix +++ b/server/mods/system.nix @@ -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