From 8931887e59ebdac5ad277958fac4b9c7be0e3526 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Mon, 1 Jan 2024 17:23:16 +0100 Subject: [PATCH] bbr tcp --- flake.nix | 2 ++ modules/kernel.nix | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 modules/kernel.nix diff --git a/flake.nix b/flake.nix index 280ad0b..88294a1 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,7 @@ ./modules/xconfig.nix ./modules/zsh.nix ./modules/prometheus.nix + ./modules/kernel.nix ]; }; @@ -24,6 +25,7 @@ ./modules/vim.nix ./modules/zsh.nix ./modules/prometheus.nix + ./modules/kernel.nix ]; }; diff --git a/modules/kernel.nix b/modules/kernel.nix new file mode 100644 index 0000000..a6ea8cc --- /dev/null +++ b/modules/kernel.nix @@ -0,0 +1,17 @@ +{ ... }: +with lib; +let cfg = config.voidcruiser.kernelTweaks; +in { + options.voidcruiser.kernelTweaks = { + enable = mkEnableOption "Enables kernel tweaks"; + }; + config = mkIf cfg.enable { + boot = { + kernelModules = [ "tcp_bbr" ]; + kernel.sysctl = { + "net.ipv4.tcp_congestion_control" = "bbr"; + "net.core.default_qdisc" = "fq"; + }; + }; + }; +}