From fad6dbb9e67642a8daec2cfb9533dc899ec6531a Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Sun, 20 Jul 2025 18:08:51 +0200 Subject: [PATCH] nixos/systemd: remove enableCgroupAccounting option --- nixos/modules/system/boot/systemd.nix | 40 ++++++++------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index c158f1bab429..f543142a60ec 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -406,14 +406,6 @@ in ''; }; - enableCgroupAccounting = mkOption { - default = true; - type = types.bool; - description = '' - Whether to enable cgroup accounting; see {manpage}`cgroups(7)`. - ''; - }; - settings.Manager = mkOption { default = { }; defaultText = lib.literalExpression '' @@ -424,24 +416,6 @@ in ''; type = lib.types.submodule { freeformType = types.attrsOf unitOption; - options = { - DefaultIOAccounting = mkOption { - type = types.bool; - default = cfg.enableCgroupAccounting; - defaultText = lib.literalExpression "config.systemd.enableCgroupAccounting"; - description = "Turn on Block I/O accounting."; - }; - - DefaultIPAccounting = mkOption { - type = types.bool; - default = cfg.enableCgroupAccounting; - defaultText = lib.literalExpression "config.systemd.enableCgroupAccounting"; - description = '' - If true, turns on IPv4 and IPv6 network traffic accounting for packets sent or received by the unit. When - this option is turned on, all IPv4 and IPv6 sockets created by any process are accounted for. - ''; - }; - }; }; example = { WatchdogDevice = "/dev/watchdog"; @@ -703,9 +677,13 @@ in config.boot.extraSystemdUnitPaths != [ ] ) "${builtins.concatStringsSep ":" config.boot.extraSystemdUnitPaths}:"; }; - systemd.settings.Manager.ManagerEnvironment = lib.concatStringsSep " " ( - lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment - ); + systemd.settings.Manager = { + ManagerEnvironment = lib.concatStringsSep " " ( + lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment + ); + DefaultIOAccounting = lib.mkDefault true; + DefaultIPAccounting = lib.mkDefault true; + }; system.requiredKernelConfig = map config.lib.kernelConfig.isEnabled [ "DEVTMPFS" @@ -832,5 +810,9 @@ in [ "systemd" "watchdog" "kexecTime" ] [ "systemd" "settings" "Manager" "KExecWatchdogSec" ] ) + (mkRemovedOptionModule [ + "systemd" + "enableCgroupAccounting" + ] "To disable cgroup accounting, disable systemd.settings.Manager.*Accounting directly.") ]; }