1 { config, pkgs, lib, hostName, ... }:
4 networking/nftables.nix
8 domain = lib.mkDefault "wg";
9 #search = [ "sourcephile.fr" ];
11 enable = lib.mkDefault true;
12 allowPing = lib.mkDefault true;
15 enable = lib.mkDefault config.services.xserver.enable;
17 logLevel = lib.mkDefault "INFO";
20 #backend = "wpa_supplicant";
21 powersave = lib.mkDefault false;
24 usePredictableInterfaceNames = true;
27 programs.mtr.enable = true;
28 programs.usbtop.enable = true;
29 environment.systemPackages = [
34 enable = lib.mkDefault true;
35 nssmdns = lib.mkDefault true;
36 openFirewall = lib.mkDefault false;
37 publish.enable = lib.mkDefault false;
39 networking.nftables.ruleset = lib.mkIf config.services.avahi.enable (''
42 skuid root udp sport mdns udp dport mdns comment "avahi: multicast DNS"
45 '' + lib.optionalString config.services.avahi.openFirewall ''
48 udp dport mdns comment "avahi: multicast DNS"
54 enable = lib.mkDefault true;
55 forwardX11 = lib.mkDefault true;
56 openFirewall = lib.mkDefault false;
57 # Enable to switch-to-configuration
58 # with the same ssh call remotely and locally
60 { addr = "127.0.0.1"; port = 22; }
64 environment.etc."NetworkManager/dispatcher.d/congctl" = {
66 source = pkgs.writeShellScript "congctl" ''
67 case $NM_DISPATCHER_ACTION in
69 case $DEVICE_IP_IFACE in
71 # https://en.wikipedia.org/wiki/TCP_congestion_control#TCP_Westwood+
73 ip route show dev $DEVICE_IP_IFACE |
74 while read -r route; do
75 ip route change $route dev $DEVICE_IP_IFACE congctl westwood