Compare commits

...

7 commits

Author SHA1 Message Date
4bc23b38bd
feat: flake update 2025-10-10 16:48:30 -07:00
eab8c956b5
feat(grafana): add unifi polling via unpoller 2025-10-10 15:08:01 -07:00
c066c5f418
feat(tanzanite): immich
Added immich as a service that I host. We shall see if it stays
2025-10-10 15:08:01 -07:00
210d1f5a29
chore: migrate postgresql directory to redundant drives 2025-10-10 15:08:01 -07:00
2bcac06381
fix(tanzanite): disable grafana analytics 2025-10-10 15:08:01 -07:00
0c2340692a
feat(tanzanite): init grafana and prometheus 2025-10-10 15:08:01 -07:00
ed86270ec3
security(nginx): disable /metrics from dendrite 2025-10-10 15:08:01 -07:00
2 changed files with 122 additions and 33 deletions

70
flake.lock generated
View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1755511413, "lastModified": 1760084311,
"narHash": "sha256-cBBF+nwGrSroN6ZewHPFaSThyCvwBxSZMdYEH8DxDx8=", "narHash": "sha256-YpNNtvA8v28Gd3/PHXCABuBWOzR0K8CyQPga13LxBH0=",
"owner": "catppuccin", "owner": "catppuccin",
"repo": "nix", "repo": "nix",
"rev": "ca11a19d4e1d2ba5e6162f40cb71288551fd51dd", "rev": "fa3a9d5f80ebfe7f4974bc1939f558690cc56359",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -86,7 +86,10 @@
}, },
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": [
"nixpkgs-xr",
"systems"
]
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@ -131,11 +134,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1755569926, "lastModified": 1760130406,
"narHash": "sha256-s7D28zPHlFWVZ7dDxm0L1o5+t423rMJUfgCMGUeyYSk=", "narHash": "sha256-GKMwBaFRw/C1p1VtjDz4DyhyzjKUWyi1K50bh8lgA2E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c613ac14f5600033bf84ae75c315d5ce24a0229b", "rev": "d305eece827a3fe317a2d70138f53feccaf890a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -174,11 +177,11 @@
"mobile-nixos": { "mobile-nixos": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1754708713, "lastModified": 1759261417,
"narHash": "sha256-IzpB0REbJ10A8vZIXnrPoUXEHL4wq8xq2pAlwyiCNb4=", "narHash": "sha256-TjuoBb8+isL3KTdGgtYh90XPyeUMFbgNAOG9l23CB3A=",
"owner": "nixos", "owner": "nixos",
"repo": "mobile-nixos", "repo": "mobile-nixos",
"rev": "b23f377ed5c458216591bd19c232cb45b2c3f365", "rev": "e6f6d527bf6abf94dd52fbba3143a720cef96431",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -189,11 +192,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1755330281, "lastModified": 1760106635,
"narHash": "sha256-aJHFJWP9AuI8jUGzI77LYcSlkA9wJnOIg4ZqftwNGXA=", "narHash": "sha256-2GoxVaKWTHBxRoeUYSjv0AfSOx4qw5CWSFz2b+VolKU=",
"owner": "Nixos", "owner": "Nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "3dac8a872557e0ca8c083cdcfc2f218d18e113b0", "rev": "9ed85f8afebf2b7478f25db0a98d0e782c0ed903",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -205,11 +208,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1755027561, "lastModified": 1759831965,
"narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", "rev": "c9b6fb798541223bbb396d287d16f43520250518",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -256,14 +259,15 @@
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"systems": "systems",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1755566862, "lastModified": 1760059371,
"narHash": "sha256-x25ELwy7HytGyVfkJ360omF5+5k5JUAw5YeG5pVMTEc=", "narHash": "sha256-VoyVxOb3maiV8ybnaCd4Zalfqz4ashIrz2pfhK704mI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-xr", "repo": "nixpkgs-xr",
"rev": "f2492718d5552951e85a89448647564ebcde7146", "rev": "6cb9cca13659e5d5c4e4a42d7f9cd7b9eecc730b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -274,11 +278,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1755186698, "lastModified": 1760038930,
"narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -290,11 +294,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1755186698, "lastModified": 1759831965,
"narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", "rev": "c9b6fb798541223bbb396d287d16f43520250518",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -366,16 +370,16 @@
}, },
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1689347949,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"type": "github" "type": "github"
} }
}, },
@ -387,11 +391,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1754847726, "lastModified": 1758728421,
"narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=", "narHash": "sha256-ySNJ008muQAds2JemiyrWYbwbG+V7S5wg3ZVKGHSFu8=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408", "rev": "5eda4ee8121f97b218f7cc73f5172098d458f1d1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -65,6 +65,18 @@ in {
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:9008"; proxyPass = "http://127.0.0.1:9008";
}; };
locations."/metrics" = {
return = "404";
};
};
"pics.stitchy.moe" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://[::1]:${toString config.services.immich.port}";
proxyWebsockets = true;
recommendedProxySettings = true;
};
}; };
"syncv3.stitchy.moe" = { "syncv3.stitchy.moe" = {
enableACME = true; enableACME = true;
@ -73,6 +85,79 @@ in {
proxyPass = "http://127.0.0.1:8009"; proxyPass = "http://127.0.0.1:8009";
}; };
}; };
"grafana.stitchy.moe" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:3000";
};
extraConfig = ''
allow 10.100.0.0/24;
allow 192.168.51.2;
allow 192.168.51.1;
deny all;
'';
};
};
};
services = {
grafana = {
enable = true;
settings = {
analytics = {
feedback_links_enabled = false;
reporting_enabled = false;
};
};
};
immich = {
enable = true;
port = 2283;
mediaLocation = "/opt/services/immich";
};
postgresql = {
dataDir = "/opt/services/postgresql/${config.services.postgresql.package.psqlSchema}";
};
prometheus = {
enable = true;
exporters = {
node = {
enable = true;
};
unpoller = {
enable = true;
controllers = [{
user = "flyingstitchman";
pass = "/persist/unifi-pass.txt";
verify_ssl = false;
url = "https://localhost:7443";
save_dpi = true;
}];
};
};
globalConfig.scrape_interval = "10s";
scrapeConfigs = [{
job_name = "node";
static_configs = [{
targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}"];
}];
}
{
job_name = "dendrite";
static_configs = [{
targets = [ "localhost:9008"];
}];
}
{
job_name = "unpoller";
static_configs = [{
targets = [ "localhost:9130"];
}];
}
];
};
unpoller = {
}; };
}; };