Compare commits
2 commits
079ece082a
...
3bc12ecfa3
Author | SHA1 | Date | |
---|---|---|---|
3bc12ecfa3 | |||
4e9bf3ebac |
3 changed files with 64 additions and 0 deletions
|
@ -71,6 +71,21 @@
|
||||||
layout = "us";
|
layout = "us";
|
||||||
xkbVariant = "";
|
xkbVariant = "";
|
||||||
};
|
};
|
||||||
|
# Keyboard mapping on internal keyboard
|
||||||
|
services.keyd = {
|
||||||
|
enable = true;
|
||||||
|
keyboards = {
|
||||||
|
"internal" = {
|
||||||
|
ids = [ "0b05:1866" ];
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
capslock = "overload(control, esc)";
|
||||||
|
leftcontrol = "capslock";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./restic.nix
|
./restic.nix
|
||||||
./vaultwarden.nix
|
./vaultwarden.nix
|
||||||
|
./prometheus.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
48
modules/nixos/prometheus.nix
Normal file
48
modules/nixos/prometheus.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.custom.prometheus;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
custom.prometheus = {
|
||||||
|
enable = mkEnableOption "Prometheus instance";
|
||||||
|
exporters = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable Prometheus exporter on every supported services";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.prometheus = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
port = 9091;
|
||||||
|
exporters = {
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [ "systemd" ];
|
||||||
|
port = 9100;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
scrapeConfigs = [
|
||||||
|
{ job_name = "prometheus";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "localhost:${toString config.services.prometheus.port}" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{ job_name = "node";
|
||||||
|
static_configs = [
|
||||||
|
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue