nixos/sysstat: provide a type for each module option

This commit is contained in:
Aaron Andersen 2019-12-30 10:43:36 -05:00 committed by Bjørn Forsman
parent de4b7d51e9
commit 7c8d98f8df

View file

@ -5,15 +5,10 @@ let
in {
options = {
services.sysstat = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable sar system activity collection.
'';
};
enable = mkEnableOption "sar system activity collection";
collect-frequency = mkOption {
type = types.str;
default = "*:00/10";
description = ''
OnCalendar specification for sysstat-collect
@ -21,6 +16,7 @@ in {
};
collect-args = mkOption {
type = types.str;
default = "1 1";
description = ''
Arguments to pass sa1 when collecting statistics
@ -33,13 +29,13 @@ in {
systemd.services.sysstat = {
description = "Resets System Activity Logs";
wantedBy = [ "multi-user.target" ];
preStart = "test -d /var/log/sa || mkdir -p /var/log/sa";
serviceConfig = {
User = "root";
RemainAfterExit = true;
Type = "oneshot";
ExecStart = "${pkgs.sysstat}/lib/sa/sa1 --boot";
LogsDirectory = "sa";
};
};