modules/nixos: add cgroups and exporter
This commit is contained in:
parent
d51acadb72
commit
b85d4b06a9
3 changed files with 33 additions and 0 deletions
modules/nixos
31
modules/nixos/cgroups.nix
Normal file
31
modules/nixos/cgroups.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.cgroup-exporter.nixosModules.default
|
||||
];
|
||||
|
||||
services.prometheus.exporters.cgroup.enable = true;
|
||||
|
||||
services.telegraf.extraConfig.inputs.prometheus.urls = [
|
||||
"http://localhost:${toString config.services.prometheus.exporters.cgroup.port}/metrics"
|
||||
];
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixVersions.nix_2_25;
|
||||
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"auto-allocate-uids"
|
||||
"cgroups"
|
||||
];
|
||||
|
||||
auto-allocate-uids = true;
|
||||
use-cgroups = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue