xsettingsd: enable service for dynamic GTK theme switching
[julm/julm-nix.git] / hosts / aubergine / networking.nix
index 81b1e39f8d1806ca1695d13f079f29fb37f58c6b..30dd947f168406c1e26496e5f0da2c9dff1e71c0 100644 (file)
@@ -1,5 +1,4 @@
-{ lib, ... }:
-with lib;
+{ pkgs, lib, config, ... }:
 with (import networking/names-and-numbers.nix);
 {
   imports = [
@@ -8,18 +7,27 @@ with (import networking/names-and-numbers.nix);
     networking/wifi.nix
     networking/lte.nix
     networking/nftables.nix
-    ./wireguard.nix
     ../../nixos/profiles/dnscrypt-proxy2.nix
-    ../../nixos/profiles/wireguard/wg-intra.nix
+    ../../nixos/profiles/printing.nix
     ../../nixos/profiles/networking/ssh.nix
   ];
   install.substituteOnDestination = false;
-  networking.domain = "wg";
+  networking.domain = "sp";
   networking.useDHCP = false;
 
   boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
-  networking.nftables.ruleset = mkAfter ''
+  networking.nftables.ruleset = lib.mkAfter ''
     table inet filter {
+      chain input-lan {
+        meta l4proto { udp, tcp } th dport domain counter accept comment "DNS"
+        meta l4proto { udp, tcp } th dport bootps counter accept comment "DHCP"
+      }
+      chain output-lan {
+        meta skuid ${config.users.users."systemd-network".name} \
+          meta l4proto { udp, tcp } th sport bootps \
+          meta l4proto { udp, tcp } th dport bootpc \
+          counter accept comment "DHCP rebinding/renewing"
+      }
       chain forward-to-lan {
         #jump forward-connectivity
         counter accept
@@ -29,7 +37,8 @@ with (import networking/names-and-numbers.nix);
         counter accept
       }
       chain forward-from-net {
-        ct state { established, related } accept
+        ct state established accept
+        ct state related accept
         log level warn prefix "forward-from-net: " counter drop
       }
       chain forward {
@@ -42,7 +51,6 @@ with (import networking/names-and-numbers.nix);
   services.avahi = {
     enable = true;
     openFirewall = true;
-    nssmdns = true;
     publish = {
       enable = true;
       addresses = true;
@@ -51,6 +59,7 @@ with (import networking/names-and-numbers.nix);
       userServices = true;
       workstation = true;
     };
+    reflector = true;
   };
   # WARNING: settings.listen_addresses are not merged...
   # hence there all defined here.
@@ -70,4 +79,9 @@ with (import networking/names-and-numbers.nix);
   systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
     "host.key:${ssh/host.key.cred}"
   ];
+
+  programs.wireshark = {
+    enable = true;
+    package = pkgs.wireshark-cli;
+  };
 }