mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/sysstat: provide a type for each module option
This commit is contained in:
parent
de4b7d51e9
commit
7c8d98f8df
1 changed files with 4 additions and 8 deletions
|
@ -5,15 +5,10 @@ let
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
services.sysstat = {
|
services.sysstat = {
|
||||||
enable = mkOption {
|
enable = mkEnableOption "sar system activity collection";
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to enable sar system activity collection.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
collect-frequency = mkOption {
|
collect-frequency = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "*:00/10";
|
default = "*:00/10";
|
||||||
description = ''
|
description = ''
|
||||||
OnCalendar specification for sysstat-collect
|
OnCalendar specification for sysstat-collect
|
||||||
|
@ -21,6 +16,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
collect-args = mkOption {
|
collect-args = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "1 1";
|
default = "1 1";
|
||||||
description = ''
|
description = ''
|
||||||
Arguments to pass sa1 when collecting statistics
|
Arguments to pass sa1 when collecting statistics
|
||||||
|
@ -33,13 +29,13 @@ in {
|
||||||
systemd.services.sysstat = {
|
systemd.services.sysstat = {
|
||||||
description = "Resets System Activity Logs";
|
description = "Resets System Activity Logs";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
preStart = "test -d /var/log/sa || mkdir -p /var/log/sa";
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "root";
|
User = "root";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
|
ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
|
||||||
|
LogsDirectory = "sa";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue