1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-19 16:09:19 +03:00
nixpkgs/nixos/modules/services/monitoring/arbtt.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
2017-01-01 16:45:26 +00:00
let
cfg = config.services.arbtt;
in
{
2017-01-01 16:45:26 +00:00
options = {
services.arbtt = {
enable = lib.mkEnableOption "Arbtt statistics capture service";
2017-01-01 16:45:26 +00:00
package = lib.mkPackageOption pkgs [ "haskellPackages" "arbtt" ] { };
2017-01-01 16:45:26 +00:00
logFile = lib.mkOption {
type = lib.types.str;
2017-01-01 16:45:26 +00:00
default = "%h/.arbtt/capture.log";
example = "/home/username/.arbtt-capture.log";
description = ''
2017-01-01 16:45:26 +00:00
The log file for captured samples.
'';
};
sampleRate = lib.mkOption {
type = lib.types.int;
2017-01-01 16:45:26 +00:00
default = 60;
example = 120;
description = ''
2017-01-01 16:45:26 +00:00
The sampling interval in seconds.
'';
};
};
};
config = lib.mkIf cfg.enable {
2017-01-01 16:45:26 +00:00
systemd.user.services.arbtt = {
description = "arbtt statistics capture service";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
2017-01-01 16:45:26 +00:00
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/arbtt-capture --logfile=${cfg.logFile} --sample-rate=${toString cfg.sampleRate}";
Restart = "always";
};
};
};
2024-05-13 10:38:10 +01:00
meta.maintainers = [ ];
2017-01-01 16:45:26 +00:00
}