1 { config, pkgs, lib, hostName, ... }:
3 wg-intra-peers = import wireguard/wg-intra/peers.nix;
7 networking/nftables.nix
11 domain = lib.mkDefault "localdomain";
12 #search = [ "sourcephile.fr" ];
14 enable = lib.mkDefault true;
15 allowPing = lib.mkDefault true;
18 enable = lib.mkDefault config.services.xserver.enable;
20 logLevel = lib.mkDefault "INFO";
23 #backend = "wpa_supplicant";
24 powersave = lib.mkDefault false;
27 usePredictableInterfaceNames = true;
30 programs.mtr.enable = true;
31 programs.usbtop.enable = true;
32 environment.systemPackages = [
37 enable = lib.mkDefault true;
38 nssmdns = lib.mkDefault true;
39 openFirewall = lib.mkDefault false;
40 publish.enable = lib.mkDefault false;
42 networking.nftables.ruleset = lib.mkIf config.services.avahi.enable (''
45 skuid root udp sport mdns udp dport mdns comment "avahi: multicast DNS"
48 '' + lib.optionalString config.services.avahi.openFirewall ''
51 udp dport mdns comment "avahi: multicast DNS"
57 enable = lib.mkDefault true;
58 forwardX11 = lib.mkDefault true;
59 openFirewall = lib.mkDefault false;
60 # Enable to switch-to-configuration
61 # with the same remotely and locally
63 { addr = "127.0.0.1"; port = 22; }
67 environment.etc."NetworkManager/dispatcher.d/congctl" = {
69 source = pkgs.writeShellScript "congctl" ''
70 case $NM_DISPATCHER_ACTION in
72 case $DEVICE_IP_IFACE in
74 # https://en.wikipedia.org/wiki/TCP_congestion_control#TCP_Westwood+
76 ip route show dev $DEVICE_IP_IFACE |
77 while read -r route; do
78 ip route change $route dev $DEVICE_IP_IFACE congctl westwood