summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authordavidak <git@davidak.de>2018-03-10 22:23:42 +0100
committerRok Garbas <rok@garbas.si>2018-03-27 09:15:22 +0200
commit41676002b28dc0e71306e309c2805438ed256517 (patch)
treeab9909a24f95de82db495d02fd02fa00166fa6ad /nixos/modules/system/boot/systemd.nix
parentdab9d404ce5814a0d27e347872e0e44f9901b573 (diff)
downloadnixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar.gz
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar.bz2
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar.lz
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar.xz
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.tar.zst
nixpkgs-41676002b28dc0e71306e309c2805438ed256517.zip
nixos/systemd: add option for cgroup accounting
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 92c9ee0c469..b8a2d42e0fb 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -524,6 +524,14 @@ in
       '';
     };
 
+    systemd.enableCgroupAccounting = mkOption {
+      default = false;
+      type = types.bool;
+      description = ''
+        Whether to enable cgroup accounting.
+      '';
+    };
+
     systemd.extraConfig = mkOption {
       default = "";
       type = types.lines;
@@ -725,6 +733,13 @@ in
 
       "systemd/system.conf".text = ''
         [Manager]
+        ${optionalString config.systemd.enableCgroupAccounting ''
+          DefaultCPUAccounting=yes
+          DefaultIOAccounting=yes
+          DefaultBlockIOAccounting=yes
+          DefaultMemoryAccounting=yes
+          DefaultTasksAccounting=yes
+        ''}
         ${config.systemd.extraConfig}
       '';