dots/modules/nixos/features/homepage-dashboard.nix
2026-01-20 14:55:53 +11:00

398 lines
11 KiB
Nix

{
# keep-sorted start
config,
lib,
pkgs,
# keep-sorted end
...
}:
let
port = 5004;
genSecrets =
secrets:
lib.genAttrs secrets (secret: {
file = ../../../secrets/${secret}.age;
});
insertSecrets =
secrets:
lib.genAttrs secrets (secret: ''
secret=$(cat "${config.age.secrets.${secret}.path}")
configFile=/etc/homepage-dashboard/services.yaml
${pkgs.gnused}/bin/sed -i "s#@${secret}@#$secret#" "$configFile"
'');
secrets = [
# keep-sorted start
"bazarr"
"immich"
"jellyfin"
"karakeep"
"kavita-api"
"lidarr"
"miniflux"
"nzbget"
"paperless"
"prowlarr"
"radarr"
"readarr"
"sonarr"
# keep-sorted end
];
certloc = "/var/lib/acme/fi33.buzz";
in
{
services = {
homepage-dashboard = {
enable = true;
listenPort = port;
allowedHosts = "homepage-dashboard.fi33.buzz";
services = [
{
"Media Management" = [
{
"Radarr" = {
"description" = "Movie collection manager";
"icon" = "radarr.svg";
"href" = "https://radarr.fi33.buzz/";
"widget" = {
"type" = "radarr";
"url" = "https://radarr.fi33.buzz/";
"key" = "@radarr@";
"enableQueue" = true;
};
};
}
{
"Sonarr" = {
"description" = "TV show collection manager";
"icon" = "sonarr.svg";
"href" = "https://sonarr.fi33.buzz/";
"widget" = {
"type" = "sonarr";
"url" = "https://sonarr.fi33.buzz/";
"key" = "@sonarr@";
"enableQueue" = true;
};
};
}
{
"Lidarr" = {
"description" = "Music collection manager";
"icon" = "lidarr.svg";
"href" = "https://lidarr.fi33.buzz/";
"widget" = {
"type" = "lidarr";
"url" = "https://lidarr.fi33.buzz/";
"key" = "@lidarr@";
"enableQueue" = true;
};
};
}
{
"Readarr" = {
"description" = "Book collection manager";
"icon" = "readarr.svg";
"href" = "https://readarr.fi33.buzz/";
"widget" = {
"type" = "readarr";
"url" = "https://readarr.fi33.buzz/";
"key" = "@readarr@";
"enableQueue" = true;
};
};
}
{
"Bazarr" = {
"description" = "Subtitle downloader and manager";
"icon" = "bazarr.svg";
"href" = "https://bazarr.fi33.buzz/";
"widget" = {
"type" = "bazarr";
"url" = "https://bazarr.fi33.buzz/";
"key" = "@bazarr@";
};
};
}
{
"Prowlarr" = {
"description" = "Indexer management tool";
"icon" = "prowlarr.svg";
"href" = "https://prowlarr.fi33.buzz/";
"widget" = {
"type" = "prowlarr";
"url" = "https://prowlarr.fi33.buzz/";
"key" = "@prowlarr@";
};
};
}
{
"NZBget" = {
"description" = "Usenet client";
"icon" = "nzbget.svg";
"href" = "https://nzbget.fi33.buzz/";
"widget" = {
"type" = "nzbget";
"url" = "https://nzbget.fi33.buzz/";
"username" = "nzbget";
"password" = "@nzbget@";
};
};
}
{
"qui" = {
"description" = "qBittorrent front end";
"icon" = "qui.svg";
"href" = "https://qui.fi33.buzz/";
};
}
{
"qBittorrent" = {
"description" = "BitTorrent client";
"icon" = "qbittorrent.svg";
"href" = "https://qbittorrent.fi33.buzz/";
};
}
];
}
{
"Media Streaming" = [
{
"Immich" = {
"description" = "Photo backup";
"icon" = "immich.svg";
"href" = "https://immich.fi33.buzz/";
"widget" = {
"type" = "immich";
"fields" = [
"users"
"photos"
"videos"
"storage"
];
"url" = "https://immich.fi33.buzz/";
"version" = 2;
"key" = "@immich@";
};
};
}
{
"Jellyfin" = {
"description" = "Media streaming";
"icon" = "jellyfin.svg";
"href" = "https://jellyfin.fi33.buzz/";
"widget" = {
"type" = "jellyfin";
"url" = "https://jellyfin.fi33.buzz/";
"key" = "@jellyfin@";
"enableBlocks" = true;
"enableNowPlaying" = true;
"enableUser" = true;
"showEpisodeNumber" = true;
"expandOneStreamToTwoRows" = false;
};
};
}
{
"Kavita" = {
"description" = "Book reader";
"icon" = "kavita.svg";
"href" = "https://kavita.fi33.buzz/";
"widget" = {
"type" = "kavita";
"url" = "https://kavita.fi33.buzz/";
"key" = "@kavita-api@";
};
};
}
{
"Karakeep" = {
"description" = "Web clipper";
"icon" = "karakeep.svg";
"href" = "https://karakeep.fi33.buzz/";
"widget" = {
"type" = "karakeep";
"url" = "https://karakeep.fi33.buzz/";
"key" = "@karakeep@";
};
};
}
{
"Miniflux" = {
"description" = "RSS aggregator";
"icon" = "miniflux.svg";
"href" = "https://miniflux.fi33.buzz/";
"widget" = {
"type" = "miniflux";
"url" = "https://miniflux.fi33.buzz/";
"key" = "@miniflux@";
};
};
}
{
"Paperless" = {
"description" = "Digital filing cabinet";
"icon" = "paperless.svg";
"href" = "https://paperless.fi33.buzz/";
"widget" = {
"type" = "paperlessngx";
"url" = "https://paperless.fi33.buzz/";
"username" = "admin";
"password" = "@paperless@";
};
};
}
];
}
{
"Services" = [
{
"Calibre Server" = {
"description" = "Calibre library manager";
"icon" = "calibre.svg";
"href" = "https://calibre.fi33.buzz/";
};
}
{
"copyparty" = {
"description" = "Cloud file manager";
"icon" = "sh-copyparty.svg";
"href" = "https://copyparty.fi33.buzz/";
};
}
{
"CouchDB" = {
"description" = "Obsidian sync database";
"icon" = "couchdb.svg";
"href" = "https://couchdb.fi33.buzz/_utils/";
};
}
{
"Firefly" = {
"description" = "Budget Planner";
"icon" = "firefly-iii.svg";
"href" = "https://firefly.fi33.buzz/";
};
}
{
"ntfy" = {
"description" = "Notification service";
"icon" = "ntfy.svg";
"href" = "https://ntfy-sh.fi33.buzz/";
};
}
{
"Radicale" = {
"description" = "CalDAV/CardDAV service";
"icon" = "radicale.svg";
"href" = "https://radicale.fi33.buzz";
};
}
{
"Syncthing" = {
"description" = "Decentralised file synchronisation";
"icon" = "syncthing.svg";
"href" = "https://syncthing.fi33.buzz/";
};
}
{
"Vaultwarden" = {
"description" = "Password manager";
"icon" = "vaultwarden.svg";
"href" = "https://vaultwarden.fi33.buzz/";
};
}
];
}
{
"Utilities" = [
{
"NanoKVM" = {
"description" = "Remote KVM switch";
"icon" = "mdi-console.svg";
"href" = "http://nano-kvm/";
};
}
];
}
];
settings = {
title = "Mission Control";
theme = "dark";
color = "neutral";
headerStyle = "clean";
layout = [
{
"Media Streaming" = {
style = "row";
columns = 3;
useEqualHeights = true;
};
}
{
"Services" = {
style = "row";
columns = 4;
};
}
{
"Media Management" = {
style = "row";
columns = 3;
useEqualHeights = true;
};
}
{
"Utilities" = {
style = "row";
columns = 3;
};
}
];
quicklaunch.searchDescriptions = true;
disableUpdateCheck = true;
showStats = true;
statusStyle = "dot";
};
widgets = [
{
search = {
provider = [
"duckduckgo"
"brave"
];
focus = true;
showSearchSuggestions = true;
target = "_blank";
};
}
{
resources = {
cpu = true;
memory = true;
disk = [
"/"
"/mnt/external"
];
cputemp = true;
tempmin = 0;
tempmax = 100;
units = "metric";
network = true;
uptime = true;
};
}
];
};
caddy.virtualHosts."homepage-dashboard.fi33.buzz".extraConfig = ''
reverse_proxy localhost:${toString port}
tls ${certloc}/cert.pem ${certloc}/key.pem {
protocols tls1.3
}
'';
};
# secrets
age.secrets = genSecrets secrets;
system.activationScripts = insertSecrets secrets;
}