My Nix Configuration

[services.scrutiny] init

pyrox.dev aeb14f56 2428c050

verified
Changed files
+67
lib
modules
nixos
services
scrutiny
systems
x86_64-linux
marvin
prefect
+5
lib/data/services.toml
···
host = "marvin"
extUrl = "reddit.pyrox.dev"
+
[scrutiny]
+
port = 6931
+
host = "marvin"
+
tsHost = "scrutiny"
+
[vaultwarden]
port = 6912
host = "marvin"
+28
modules/nixos/services/scrutiny/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}:
+
let
+
cfg = config.py.services.scrutiny.collector;
+
apiUrl = "https://marvin.${lib.py.data.tsNet}:${toString lib.py.data.services.scrutiny.port}";
+
in
+
{
+
options.py.services.scrutiny = {
+
collector = {
+
enable = lib.mkEnableOption "Scrutiny Collector";
+
extraSettings = lib.mkOption {
+
type = lib.types.attrs;
+
description = "Extra settings to merge to the default scrutiny collector options";
+
default = { };
+
};
+
};
+
};
+
config.services.scrutiny.collector = lib.mkIf cfg.enable {
+
enable = true;
+
settings = {
+
host.id = config.networking.hostName;
+
api.endpoint = apiUrl;
+
} // cfg.extraSettings;
+
};
+
}
+1
systems/x86_64-linux/marvin/default.nix
···
./services/postgres.nix
./services/prometheus.nix
# ./services/redlib.nix
+
./services/scrutiny.nix
./services/syncthing.nix
./services/tailscale.nix
./services/vaultwarden.nix
+32
systems/x86_64-linux/marvin/services/scrutiny.nix
···
+
{ config, lib, ... }:
+
let
+
d = lib.py.data.services.scrutiny;
+
in
+
{
+
services.scrutiny = {
+
enable = true;
+
influxdb.enable = true;
+
settings = {
+
web = {
+
listen = {
+
port = d.port;
+
};
+
influxdb.tls.insecure_skip_verify = true;
+
};
+
};
+
collector = {
+
enable = true;
+
settings = {
+
api.endpoint = "http://localhost:${toString d.port}";
+
devices = [
+
{
+
device = "/dev/sdb";
+
commands = {
+
metrics_smart_args = "-xv 188,raw16 --xall --json -T permissive";
+
};
+
}
+
];
+
};
+
};
+
};
+
}
+1
systems/x86_64-linux/prefect/default.nix
···
fish.enable = true;
neovim.enable = true;
};
+
services.scrutiny.collector.enable = true;
};
}