nixos/systemd: add option for cgroup accounting
This commit is contained in:
@@ -524,6 +524,14 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.enableCgroupAccounting = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to enable cgroup accounting.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.extraConfig = mkOption {
|
systemd.extraConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
@@ -725,6 +733,13 @@ in
|
|||||||
|
|
||||||
"systemd/system.conf".text = ''
|
"systemd/system.conf".text = ''
|
||||||
[Manager]
|
[Manager]
|
||||||
|
${optionalString config.systemd.enableCgroupAccounting ''
|
||||||
|
DefaultCPUAccounting=yes
|
||||||
|
DefaultIOAccounting=yes
|
||||||
|
DefaultBlockIOAccounting=yes
|
||||||
|
DefaultMemoryAccounting=yes
|
||||||
|
DefaultTasksAccounting=yes
|
||||||
|
''}
|
||||||
${config.systemd.extraConfig}
|
${config.systemd.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user