mirror of
https://github.com/kmein/niveum
synced 2026-03-21 04:11:07 +01:00
Compare commits
4 Commits
136000540b
...
d22682519b
| Author | SHA1 | Date | |
|---|---|---|---|
| d22682519b | |||
| b2065c4155 | |||
| 63f5db1c58 | |||
| f3a5e0a54c |
@@ -36,5 +36,18 @@
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
|
||||
niveumPackages.vim
|
||||
|
||||
# language servers
|
||||
pkgs.pyright
|
||||
pkgs.haskellPackages.haskell-language-server
|
||||
pkgs.texlab
|
||||
pkgs.nil
|
||||
pkgs.rust-analyzer
|
||||
pkgs.nodePackages.typescript-language-server
|
||||
pkgs.lua-language-server
|
||||
pkgs.nodePackages.vscode-langservers-extracted
|
||||
pkgs.lemminx
|
||||
niveumPackages.jq-lsp
|
||||
pkgs.dhall-lsp-server
|
||||
];
|
||||
}
|
||||
|
||||
@@ -232,17 +232,6 @@ in {
|
||||
]))
|
||||
# python3Packages.poetry
|
||||
|
||||
# language servers
|
||||
pyright
|
||||
haskellPackages.haskell-language-server
|
||||
texlab
|
||||
nil
|
||||
rust-analyzer
|
||||
nodePackages.typescript-language-server
|
||||
lua-language-server
|
||||
nodePackages.vscode-langservers-extracted
|
||||
|
||||
dhall-lsp-server
|
||||
dhall-nix
|
||||
dhall-bash
|
||||
dhall-json
|
||||
|
||||
@@ -112,6 +112,7 @@ local language_servers = {
|
||||
hls = {}, -- haskell-language-server
|
||||
html = {}, -- vscode-langservers-extracted
|
||||
jsonls = {}, -- vscode-langservers-extracted
|
||||
lemminx = {}, -- lemminx (for xml)
|
||||
nil_ls = {}, -- github:oxalica/nil
|
||||
dhall_lsp_server = {}, -- dhall-lsp-server
|
||||
-- rnix = {}, -- rnix-lsp
|
||||
|
||||
@@ -92,7 +92,7 @@ in {
|
||||
alert = "HostSystemdServiceCrashed";
|
||||
expr = ''(node_systemd_unit_state{state="failed"} == 1) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}'';
|
||||
annotations = {
|
||||
summary = "{{$labels.name}} failed on {{$labels.instance}}";
|
||||
description = "{{$labels.name}} failed on {{$labels.instance}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
@@ -100,7 +100,7 @@ in {
|
||||
for = "10m";
|
||||
expr = ''(node_filesystem_free_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < ${toString diskFreeThreshold}'';
|
||||
annotations = {
|
||||
summary = ''{{ $labels.instance }} running out of space: {{ $value | printf "%.2f" }}% < ${toString diskFreeThreshold}%'';
|
||||
description = ''{{ $labels.instance }} running out of space: {{ $value | printf "%.2f" }}% < ${toString diskFreeThreshold}%'';
|
||||
};
|
||||
}
|
||||
{
|
||||
@@ -110,7 +110,7 @@ in {
|
||||
''node_filesystem_free_bytes{mountpoint="/"} ''
|
||||
+ ''and predict_linear(node_filesystem_free_bytes{mountpoint="/"}[2d], 7*24*3600) <= 0'';
|
||||
annotations = {
|
||||
summary = "{{$labels.instance}} running out of space in 7 days";
|
||||
description = "{{$labels.instance}} running out of space in 7 days";
|
||||
};
|
||||
}
|
||||
{
|
||||
@@ -118,98 +118,98 @@ in {
|
||||
expr = ''node_load15 / on(job) count(node_cpu_seconds_total{mode="system"}) by (job) >= 1.0'';
|
||||
for = "10m";
|
||||
annotations = {
|
||||
summary = "{{$labels.instance}} running on high load: {{$value}}";
|
||||
description = "{{$labels.instance}} running on high load: {{$value}}";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "HostUnusualNetworkThroughputIn";
|
||||
expr = ''(rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100'';
|
||||
for = "5m";
|
||||
annotations.summary = "Host unusual network throughput in (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host unusual network throughput in (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HostUnusualNetworkThroughputOut";
|
||||
expr = ''(rate(node_network_transmit_bytes_total[2m])) / 1024 / 1024 > 100'';
|
||||
for = "5m";
|
||||
annotations.summary = "Host unusual network throughput out (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host unusual network throughput out (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HostUnusualDiskReadRate";
|
||||
expr = ''(rate(node_disk_read_bytes_total[2m])) / 1024 / 1024 > 50'';
|
||||
for = "5m";
|
||||
annotations.summary = "Host unusual disk read rate (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host unusual disk read rate (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HostUnusualDiskWriteRate";
|
||||
expr = ''(rate(node_disk_written_bytes_total[2m])) / 1024 / 1024 > 50'';
|
||||
for = "2m";
|
||||
annotations.summary = "Host unusual disk write rate (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host unusual disk write rate (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HostOutOfInodes";
|
||||
expr = ''node_filesystem_files_free{fstype!="msdosfs"} / node_filesystem_files{fstype!="msdosfs"} * 100 < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0'';
|
||||
for = "2m";
|
||||
annotations.summary = "Host out of inodes (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host out of inodes (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HostInodesWillFillIn24Hours";
|
||||
expr = ''node_filesystem_files_free{fstype!="msdosfs"} / node_filesystem_files{fstype!="msdosfs"} * 100 < 10 and predict_linear(node_filesystem_files_free{fstype!="msdosfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly{fstype!="msdosfs"} == 0'';
|
||||
for = "2m";
|
||||
annotations.summary = "Host inodes will fill in 24 hours (instance {{ $labels.instance }})";
|
||||
annotations.description = "Host inodes will fill in 24 hours (instance {{ $labels.instance }})";
|
||||
}
|
||||
{
|
||||
alert = "HighRAM";
|
||||
expr = "node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes < node_memory_MemTotal_bytes * 0.1";
|
||||
for = "1h";
|
||||
annotations.summary = "{{$labels.instance}} using lots of RAM";
|
||||
annotations.description = "{{$labels.instance}} using lots of RAM";
|
||||
}
|
||||
{
|
||||
alert = "UptimeMonster";
|
||||
expr = "time() - node_boot_time_seconds > 2592000";
|
||||
annotations.summary = "uptime monster {{$labels.instance}} up for more than 30 days";
|
||||
annotations.description = "uptime monster {{$labels.instance}} up for more than 30 days";
|
||||
}
|
||||
{
|
||||
alert = "HostDown";
|
||||
expr = ''up == 0'';
|
||||
for = "5m";
|
||||
annotations = {
|
||||
summary = "{{ $labels.instance }} seeming down since 5 minutes";
|
||||
description = "{{ $labels.instance }} seeming down since 5 minutes";
|
||||
};
|
||||
}
|
||||
{
|
||||
alert = "Reboot";
|
||||
expr = "time() - node_boot_time_seconds < 300";
|
||||
annotations.summary = "{{$labels.instance}} rebooted";
|
||||
annotations.description = "{{$labels.instance}} rebooted";
|
||||
}
|
||||
{
|
||||
alert = "ProbeFailed";
|
||||
expr = "probe_success == 0";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe failed for {{$labels.instance}}";
|
||||
annotations.description = "HTTP probe failed for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SlowProbe";
|
||||
expr = "avg_over_time(probe_http_duration_seconds[1m]) > 1";
|
||||
for = "5m";
|
||||
annotations.summary = "HTTP probe slow for {{$labels.instance}}";
|
||||
annotations.description = "HTTP probe slow for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "HttpStatusCode";
|
||||
expr = "probe_http_status_code != 0 AND (probe_http_status_code <= 199 OR probe_http_status_code >= 400)";
|
||||
for = "5m";
|
||||
annotations.summary = "status code {{$value}} for {{$labels.instance}}";
|
||||
annotations.description = "status code {{$value}} for {{$labels.instance}}";
|
||||
}
|
||||
{
|
||||
alert = "SslExpirySoon";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() < 86400 * 30";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} expires in 30 days";
|
||||
annotations.description = "SSL certificate for {{$labels.instance}} expires in 30 days";
|
||||
}
|
||||
{
|
||||
alert = "SslExpiry";
|
||||
expr = "probe_ssl_earliest_cert_expiry - time() <= 0";
|
||||
for = "5m";
|
||||
annotations.summary = "SSL certificate for {{$labels.instance}} has expired";
|
||||
annotations.description = "SSL certificate for {{$labels.instance}} has expired";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
@@ -63,8 +63,6 @@ in {
|
||||
phpOptions."opcache.interned_strings_buffer" = "32"; # buffer size in MB
|
||||
|
||||
config = {
|
||||
overwriteProtocol = "https";
|
||||
|
||||
dbtype = "pgsql";
|
||||
dbuser = "nextcloud";
|
||||
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
|
||||
@@ -73,13 +71,14 @@ in {
|
||||
adminpassFile = config.age.secrets.nextcloud-password-admin.path;
|
||||
adminuser = "admin";
|
||||
# extraTrustedDomains = [ "toum.r" ];
|
||||
defaultPhoneRegion = "DE";
|
||||
};
|
||||
|
||||
logLevel = 2;
|
||||
|
||||
extraOptions = {
|
||||
settings = {
|
||||
defaultapp = "files";
|
||||
overwriteprotocol = "https";
|
||||
default_phone_region = "DE";
|
||||
log_level = 2;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -9,10 +9,22 @@
|
||||
gid = 7452;
|
||||
};
|
||||
|
||||
fileSystems."/nas" = {
|
||||
fileSystems."/media/sd" = {
|
||||
device = "/dev/disk/by-id/5E4S5_0x4c585d15-part1";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"nofail"
|
||||
"defaults"
|
||||
"uid=${toString config.users.extraUsers.nas.uid}"
|
||||
"gid=${toString config.users.extraGroups.nas.gid}"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/media/hdd" = {
|
||||
device = "/dev/disk/by-id/0x50014ee658872039-part1";
|
||||
fsType = "ntfs";
|
||||
options = [ # ref https://askubuntu.com/a/113746
|
||||
"nofail"
|
||||
"defaults"
|
||||
"nls=utf8"
|
||||
"umask=000"
|
||||
@@ -42,7 +54,7 @@
|
||||
map to guest = Bad User
|
||||
'';
|
||||
shares.nas = {
|
||||
path = "/nas";
|
||||
path = "/media";
|
||||
browseable = "yes";
|
||||
writable = "yes";
|
||||
# "read only" = "no";
|
||||
|
||||
Reference in New Issue
Block a user