diff --git a/nixos/modules/misc/ports.nix b/nixos/modules/misc/ports.nix index 9968b42b7..7f113186e 100644 --- a/nixos/modules/misc/ports.nix +++ b/nixos/modules/misc/ports.nix @@ -21,6 +21,8 @@ ports = { ssh-honeypot = 22; dns = 53; + dhcp-server = 67; + dhcp-client = 68; http = 80; bgp = 179; https = 443; diff --git a/nixos/profiles/graphical/gnome/default.nix b/nixos/profiles/graphical/gnome/default.nix index fefc73e76..a1cb5a9de 100644 --- a/nixos/profiles/graphical/gnome/default.nix +++ b/nixos/profiles/graphical/gnome/default.nix @@ -93,8 +93,8 @@ lib.mkIf config.services.xserver.desktopManager.gnome.enable { 3389 # RDP ]; networking.firewall.allowedUDPPorts = [ - 53 # DNS server for hotsport - 67 # DHCP server for hotsport + config.ports.dns # DNS server for hotsport + config.ports.dhcp-server # DHCP server for hotsport ]; environment.global-persistence.user = { diff --git a/nixos/profiles/virtualization/libvirt/default.nix b/nixos/profiles/virtualization/libvirt/default.nix index a24de2566..9683e724e 100644 --- a/nixos/profiles/virtualization/libvirt/default.nix +++ b/nixos/profiles/virtualization/libvirt/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: let winVirtioIso = pkgs.runCommand "win-virtio-iso" { } '' mkdir -p "$out/share/win-virtio" @@ -24,4 +24,9 @@ in # virtio win environment.systemPackages = [ winVirtioIso ]; environment.pathsToLink = [ "/share/win-virtio" ]; + + networking.firewall.allowedUDPPorts = [ + config.ports.dns + config.ports.dhcp-server + ]; }