git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/systemd: add option for cgroup accounting
commit41676002b28dc0e71306e309c2805438ed256517 authordavidak <git@davidak.de> dateSat 10 Mar 2018, 22:23 (9 years ago) parentdab9d40
1 file changed+15
nixos/modules/system/boot/systemd.nix+15
nixos/modules/system/boot/systemd.nix+15
@@ -524,6 +524,14 @@ in
524524 '';
525525 };
526526
527+ systemd.enableCgroupAccounting = mkOption {
528+ default = false;
529+ type = types.bool;
530+ description = ''
531+ Whether to enable cgroup accounting.
532+ '';
533+ };
534+
527535 systemd.extraConfig = mkOption {
528536 default = "";
529537 type = types.lines;
@@ -725,6 +733,13 @@ in
725733
726734 "systemd/system.conf".text = ''
727735 [Manager]
736+ ${optionalString config.systemd.enableCgroupAccounting ''
737+ DefaultCPUAccounting=yes
738+ DefaultIOAccounting=yes
739+ DefaultBlockIOAccounting=yes
740+ DefaultMemoryAccounting=yes
741+ DefaultTasksAccounting=yes
742+ ''}
728743 ${config.systemd.extraConfig}
729744 '';
730745