feat: Added grafana other devices

This commit is contained in:
uttarayan21
2025-08-14 15:18:52 +05:30
parent e387716e16
commit ba40cc49eb
10 changed files with 298 additions and 803 deletions

View File

@@ -2,7 +2,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
home.packages = with pkgs; [ home.packages = with pkgs; [
nixd nixd
nil nil
@@ -43,6 +44,13 @@
reveal_target = "center"; reveal_target = "center";
} }
]; ];
"space f g" = [
"task::Spawn"
{
task_name = "file_manager";
reveal_target = "center";
}
];
}; };
} }
{ {
@@ -119,14 +127,27 @@
userTasks = [ userTasks = [
{ {
label = "file_finder"; label = "file_finder";
command = "${lib.getExe pkgs.zed-editor} \"$(tv files)\""; command = "${lib.getExe pkgs.zed-editor} \"$(${lib.getExe pkgs.television} files)\"";
hide = "always"; hide = "always";
allow_concurrent_runs = true; allow_concurrent_runs = true;
use_new_terminal = true; use_new_terminal = true;
} }
{ {
label = "live_grep"; label = "live_grep";
command = "tv text | read -alz res; and ${lib.getExe pkgs.zed-editor} $res"; command = "${lib.getExe pkgs.television} text | read -alz res; and ${lib.getExe pkgs.zed-editor} $res";
hide = "always";
allow_concurrent_runs = false;
use_new_terminal = false;
shell = {
with_arguments = {
program = "fish";
args = [ "--no-config" ];
};
};
}
{
label = "file_manager";
command = "${lib.getExe pkgs.yazi} --chooser-file /dev/stdout | read -alz res;and ${lib.getExe pkgs.zed-editor} $res";
hide = "always"; hide = "always";
allow_concurrent_runs = false; allow_concurrent_runs = false;
use_new_terminal = false; use_new_terminal = false;

View File

@@ -5,7 +5,8 @@
lib, lib,
device, device,
... ...
}: { }:
{
imports = [ imports = [
inputs.nix-index-database.homeModules.nix-index inputs.nix-index-database.homeModules.nix-index
../modules ../modules
@@ -23,7 +24,9 @@
}; };
programs = { programs = {
home-manager = {enable = true;}; home-manager = {
enable = true;
};
}; };
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
@@ -31,16 +34,12 @@
home = { home = {
username = device.user; username = device.user;
homeDirectory = homeDirectory =
if device.isDarwin if device.isDarwin then lib.mkForce "/Users/${device.user}" else lib.mkForce "/home/${device.user}";
then lib.mkForce "/Users/${device.user}"
else lib.mkForce "/home/${device.user}";
file = { file = {
".config/fish/themes".source = pkgs.catppuccinThemes.fish + "/themes"; ".config/fish/themes".source = pkgs.catppuccinThemes.fish + "/themes";
".cargo/config.toml".text = ".cargo/config.toml".text =
/* # toml
toml
*/
'' ''
[alias] [alias]
lldb = ["with", "rust-lldb", "--"] lldb = ["with", "rust-lldb", "--"]
@@ -61,12 +60,12 @@
EDITOR = "nvim"; EDITOR = "nvim";
SHELL = "${pkgs.bash}/bin/bash"; SHELL = "${pkgs.bash}/bin/bash";
CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target"; CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target";
BROWSER = BROWSER = if device.isDarwin then "open" else "xdg-open";
if device.isDarwin
then "open"
else "xdg-open";
}; };
sessionPath = ["${config.home.homeDirectory}/.cargo/bin" "${config.home.homeDirectory}/.local/bin"]; sessionPath = [
"${config.home.homeDirectory}/.cargo/bin"
"${config.home.homeDirectory}/.local/bin"
];
stateVersion = "23.11"; stateVersion = "23.11";
}; };

View File

@@ -2,7 +2,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
imports = [ imports = [
./goread.nix ./goread.nix
./hyprpaper.nix ./hyprpaper.nix

View File

@@ -2,29 +2,40 @@
pkgs, pkgs,
# config, # config,
... ...
}: let }:
mkMappings = mappings: let
mkMappings =
mappings:
[ ] [ ]
++ (pkgs.lib.optionals (builtins.hasAttr "normal" mappings) (mkMode mappings.normal "n")) ++ (pkgs.lib.optionals (builtins.hasAttr "normal" mappings) (mkMode mappings.normal "n"))
++ (pkgs.lib.optionals (builtins.hasAttr "terminal" mappings) (mkMode mappings.terminal "t")) ++ (pkgs.lib.optionals (builtins.hasAttr "terminal" mappings) (mkMode mappings.terminal "t"))
++ (pkgs.lib.optionals (builtins.hasAttr "insert" mappings) (mkMode mappings.insert "i")) ++ (pkgs.lib.optionals (builtins.hasAttr "insert" mappings) (mkMode mappings.insert "i"))
++ (pkgs.lib.optionals (builtins.hasAttr "visual" mappings) (mkMode mappings.visual "v")) ++ (pkgs.lib.optionals (builtins.hasAttr "visual" mappings) (mkMode mappings.visual "v"))
++ (pkgs.lib.optionals (builtins.hasAttr "global" mappings) (mkMode mappings.global "")); ++ (pkgs.lib.optionals (builtins.hasAttr "global" mappings) (mkMode mappings.global ""));
mkMode = mappings: mode: mkMode =
pkgs.lib.mapAttrsToList mappings: mode:
(key: value: { pkgs.lib.mapAttrsToList (key: value: {
key = key; key = key;
action = rawLua value; action = rawLua value;
mode = mode; mode = mode;
}) }) mappings;
mappings; border = [
border = ["" "" "" "" "" "" "" ""]; ""
""
""
""
""
""
""
""
];
rawLua = lua: { rawLua = lua: {
"__raw" = '' "__raw" = ''
${lua} ${lua}
''; '';
}; };
in { in
{
opts = { opts = {
completeopt = "menu,menuone,popup,noselect"; completeopt = "menu,menuone,popup,noselect";
expandtab = true; expandtab = true;
@@ -113,7 +124,10 @@ in {
autoCmd = [ autoCmd = [
{ {
event = ["BufEnter" "BufWinEnter"]; event = [
"BufEnter"
"BufWinEnter"
];
pattern = "*.norg"; pattern = "*.norg";
command = "set conceallevel=3"; command = "set conceallevel=3";
} }
@@ -148,9 +162,7 @@ in {
enable = true; enable = true;
settings = { settings = {
format_on_save = format_on_save =
/* # lua
lua
*/
'' ''
function(bufnr) function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
@@ -182,27 +194,6 @@ in {
}; };
}; };
}; };
avante = {
enable = true;
settings = {
provider = "copilot";
providers = {
ollama = {
endpoint = "https://ollama.ryu.darksailor.dev";
model = "qwen3:30b-a3b";
};
};
input = {
provider = "snacks";
provider_opts = {
# Additional snacks.input options
title = "Avante Input";
icon = " ";
};
};
};
};
snacks.enable = true;
yazi = { yazi = {
enable = true; enable = true;
@@ -296,9 +287,7 @@ in {
comment = { comment = {
enable = true; enable = true;
settings.pre_hook = settings.pre_hook =
/* # lua
lua
*/
'' ''
require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()
''; '';
@@ -391,9 +380,7 @@ in {
settings = { settings = {
close_fold_kinds = null; close_fold_kinds = null;
provider_selector = provider_selector =
/* # lua
lua
*/
'' ''
function(bufnr, filetype, buftype) function(bufnr, filetype, buftype)
return {'treesitter', 'indent'} return {'treesitter', 'indent'}
@@ -407,9 +394,7 @@ in {
server = { server = {
on_attach = on_attach =
rawLua rawLua
/* # lua
lua
*/
'' ''
function(client, bufnr) function(client, bufnr)
vim.keymap.set( vim.keymap.set(
@@ -462,16 +447,19 @@ in {
}; };
}; };
}; };
dap = let dap =
let
vscode-lldb = pkgs.vscode-extensions.vadimcn.vscode-lldb; vscode-lldb = pkgs.vscode-extensions.vadimcn.vscode-lldb;
liblldb = liblldb =
if pkgs.stdenv.isLinux if pkgs.stdenv.isLinux then
then "${vscode-lldb.lldb}/lib/liblldb.so" "${vscode-lldb.lldb}/lib/liblldb.so"
else if pkgs.stdenv.isDarwin else if pkgs.stdenv.isDarwin then
then "${vscode-lldb.lldb}/lib/liblldb.dylib" "${vscode-lldb.lldb}/lib/liblldb.dylib"
else null; else
null;
codelldb = "${vscode-lldb.adapter}/bin/codelldb"; codelldb = "${vscode-lldb.adapter}/bin/codelldb";
in { in
{
autoload_configurations = false; autoload_configurations = false;
# adapter = # adapter =
# /* # /*
@@ -482,7 +470,9 @@ in {
# ''; # '';
}; };
tools = { tools = {
float_win_config = {border = "rounded";}; float_win_config = {
border = "rounded";
};
enable_clippy = false; enable_clippy = false;
}; };
}; };
@@ -628,9 +618,7 @@ in {
"<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
}; };
snippet.expand = snippet.expand =
/* # lua
lua
*/
'' ''
function(args) function(args)
require('luasnip').lsp_expand(args.body) require('luasnip').lsp_expand(args.body)
@@ -640,9 +628,7 @@ in {
}; };
}; };
extraConfigLua = extraConfigLua =
/* # lua
lua
*/
'' ''
function catcher(callback) function catcher(callback)
do do
@@ -802,6 +788,18 @@ in {
pkgs.tree-sitter-grammars.tree-sitter-norg-meta pkgs.tree-sitter-grammars.tree-sitter-norg-meta
pkgs.tree-sitter-grammars.tree-sitter-nu pkgs.tree-sitter-grammars.tree-sitter-nu
]; ];
extraLuaPackages = luaPkgs: with luaPkgs; [lua-utils-nvim nvim-nio pathlib-nvim]; extraLuaPackages =
extraPackages = [pkgs.lldb pkgs.taplo pkgs.d2 pkgs.sleek pkgs.graphqurl pkgs.sqls]; luaPkgs: with luaPkgs; [
lua-utils-nvim
nvim-nio
pathlib-nvim
];
extraPackages = [
pkgs.lldb
pkgs.taplo
pkgs.d2
pkgs.sleek
pkgs.graphqurl
pkgs.sqls
];
} }

View File

@@ -75,6 +75,26 @@
static_configs = [ static_configs = [
{ {
targets = [ "127.0.0.1:9100" ]; targets = [ "127.0.0.1:9100" ];
labels = {
device = "mirai";
type = "server";
};
}
{
targets = [ "tsuba:9100" ];
labels = {
device = "tsuba";
type = "server";
arch = "aarch64";
};
}
{
targets = [ "ryu:9100" ];
labels = {
device = "ryu";
type = "desktop";
arch = "x86_64";
};
} }
]; ];
} }
@@ -83,6 +103,26 @@
static_configs = [ static_configs = [
{ {
targets = [ "127.0.0.1:9256" ]; targets = [ "127.0.0.1:9256" ];
labels = {
device = "mirai";
type = "server";
};
}
{
targets = [ "tsuba:9256" ];
labels = {
device = "tsuba";
type = "server";
arch = "aarch64";
};
}
{
targets = [ "ryu:9256" ];
labels = {
device = "ryu";
type = "desktop";
arch = "x86_64";
};
} }
]; ];
} }
@@ -91,6 +131,9 @@
static_configs = [ static_configs = [
{ {
targets = [ "127.0.0.1:9090" ]; targets = [ "127.0.0.1:9090" ];
labels = {
device = "mirai";
};
} }
]; ];
} }
@@ -112,13 +155,13 @@
settings = { settings = {
access_control = { access_control = {
rules = [ rules = [
# { {
# domain = "grafana.darksailor.dev"; domain = "grafana.darksailor.dev";
# policy = "bypass"; policy = "bypass";
# resources = [ resources = [
# "^/api([/?].*)?$" "^/api([/?].*)?$"
# ]; ];
# } }
{ {
domain = "grafana.darksailor.dev"; domain = "grafana.darksailor.dev";
policy = "one_factor"; policy = "one_factor";
@@ -144,7 +187,6 @@
# Provision dashboards directly # Provision dashboards directly
environment.etc = { environment.etc = {
"grafana/dashboards/system-dashboard.json".source = ./grafana/system-dashboard.json; "grafana/dashboards/system-dashboard.json".source = ./grafana/system-dashboard.json;
"grafana/dashboards/services-dashboard.json".source = ./grafana/services-dashboard.json;
"grafana/dashboards/processes-dashboard.json".source = ./grafana/processes-dashboard.json; "grafana/dashboards/processes-dashboard.json".source = ./grafana/processes-dashboard.json;
}; };
} }

View File

@@ -1,654 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"vis": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "node_systemd_unit_state{state=\"active\", name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Service Status (Active Services)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [
{
"options": {
"0": {
"color": "red",
"index": 0,
"text": "Inactive"
},
"1": {
"color": "green",
"index": 1,
"text": "Active"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 1
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 12,
"x": 0,
"y": 8
},
"id": 2,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": ["sum"],
"show": false
},
"showHeader": true
},
"pluginVersion": "8.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "node_systemd_unit_state{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\", state=\"active\"}",
"format": "table",
"instant": true,
"intervalFactor": 1,
"legendFormat": "",
"refId": "A"
}
],
"title": "Service Status Table",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"__name__": true,
"instance": true,
"job": true,
"state": true
},
"indexByName": {},
"renameByName": {
"Value": "Status",
"name": "Service"
}
}
}
],
"type": "table"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"x": 12,
"y": 8
},
"id": 3,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "count(node_systemd_unit_state{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\", state=\"active\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "Active Services",
"refId": "A"
}
],
"title": "Total Active Services",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 1
},
{
"color": "red",
"value": 5
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"x": 18,
"y": 8
},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "8.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "count(node_systemd_unit_state{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\", state=\"failed\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "Failed Services",
"refId": "A"
}
],
"title": "Failed Services",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"vis": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 14
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "time() - node_systemd_unit_state_start_time_seconds{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\", state=\"active\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Service Uptime",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"vis": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 20
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "increase(node_systemd_unit_state_restarts_total{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\"}[1h])",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{name}}",
"refId": "A"
}
],
"title": "Service Restarts (Last Hour)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 28
},
"id": 7,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": ["sum"],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Start Time"
}
]
},
"pluginVersion": "8.0.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "node_systemd_unit_state_start_time_seconds{name=~\"(atuin|authelia|caddy|gitea|grafana|immich|navidrome|nextcloud|paperless|prowlarr|seafile|searxng|syncthing|tailscale|lldap|prometheus)\\.service\", state=\"active\"}",
"format": "table",
"instant": true,
"intervalFactor": 1,
"legendFormat": "",
"refId": "A"
}
],
"title": "Service Start Times",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"__name__": true,
"instance": true,
"job": true,
"state": true
},
"indexByName": {},
"renameByName": {
"Value": "Start Time",
"name": "Service"
}
}
},
{
"id": "convertFieldType",
"options": {
"conversions": [
{
"destinationType": "time",
"targetField": "Start Time"
}
],
"fields": {}
}
}
],
"type": "table"
}
],
"refresh": "30s",
"schemaVersion": 27,
"style": "dark",
"tags": ["services", "monitoring", "systemd"],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Services Monitoring Dashboard",
"uid": "services-monitoring",
"version": 1
}

View File

@@ -1,4 +1,5 @@
{...}: { { ... }:
{
imports = [ imports = [
# ./rsyncd.nix # ./rsyncd.nix
# ./sunshine.nix # ./sunshine.nix
@@ -15,5 +16,6 @@
./minecraft.nix ./minecraft.nix
./fwupd.nix ./fwupd.nix
./caddy.nix ./caddy.nix
./monitoring.nix
]; ];
} }

View File

@@ -0,0 +1,42 @@
{ ... }:
{
services = {
prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [
"systemd"
"textfile"
"filesystem"
"loadavg"
"meminfo"
"netdev"
"stat"
"time"
"uname"
"vmstat"
];
port = 9100;
};
process = {
enable = true;
settings.process_names = [
{
name = "{{.Comm}}";
cmdline = [ ".*" ];
}
];
};
};
};
};
# Open firewall ports for Prometheus exporters
networking.firewall = {
allowedTCPPorts = [
9100 # node exporter
9256 # process exporter
];
};
}

View File

@@ -1,4 +1,5 @@
{...}: { { ... }:
{
imports = [ imports = [
./tailscale.nix ./tailscale.nix
./samba.nix ./samba.nix
@@ -9,6 +10,7 @@
./homeassistant.nix ./homeassistant.nix
./flaresolverr.nix ./flaresolverr.nix
./caddy.nix ./caddy.nix
./monitoring.nix
# ./grafana.nix # ./grafana.nix
# ./dnscrypt.nix # ./dnscrypt.nix
# ./resolved.nix # ./resolved.nix

View File

@@ -0,0 +1,42 @@
{ ... }:
{
services = {
prometheus = {
exporters = {
node = {
enable = true;
enabledCollectors = [
"systemd"
"textfile"
"filesystem"
"loadavg"
"meminfo"
"netdev"
"stat"
"time"
"uname"
"vmstat"
];
port = 9100;
};
process = {
enable = true;
settings.process_names = [
{
name = "{{.Comm}}";
cmdline = [ ".*" ];
}
];
};
};
};
};
# Open firewall ports for Prometheus exporters
networking.firewall = {
allowedTCPPorts = [
9100 # node exporter
9256 # process exporter
];
};
}