refactor: move networking into its own module

This commit is contained in:
Mohammad Rafiq 2025-03-27 02:26:13 +08:00
parent e181c1c4f3
commit d5b4b54403
No known key found for this signature in database
4 changed files with 43 additions and 47 deletions

View file

@ -1,8 +1,6 @@
{
boot.loader = {
timeout = 5;
systemd-boot.enable = true;
systemd-boot.configurationLimit = 5;
efi.canTouchEfiVariables = true;
};
}

View file

@ -0,0 +1,32 @@
{ hostname, lib, ... }:
{
networking = {
hostName = hostname;
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
networkmanager.wifi.backend = "iwd";
# Configures a simple stateful firewall.
# By default, it doesn't allow any incoming connections.
firewall = {
enable = true;
allowedTCPPorts = [
22 # SSH
];
allowedUDPPorts = [ ];
};
interfaces.enp12s0.wakeOnLan.policy = [
"phy"
"unicast"
"multicast"
"broadcast"
"arp"
"magic"
"secureon"
];
interfaces.enp12s0.wakeOnLan.enable = true;
};
services.openssh.enable = true;
services.tailscale.enable = true;
}

View file

@ -1,3 +0,0 @@
{
services.tailscale.enable = true;
}