refactor: switch from modules to import arrays
This commit is contained in:
parent
d893750c09
commit
41eaa38d31
75 changed files with 1870 additions and 2541 deletions
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
# keep-sorted start
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
# keep-sorted end
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = "homepage-dashboard";
|
||||
port = "5004";
|
||||
genSecrets =
|
||||
secrets:
|
||||
|
|
@ -34,280 +35,269 @@ let
|
|||
];
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
services = {
|
||||
# service
|
||||
homepage-dashboard = {
|
||||
enable = true;
|
||||
listenPort = lib.toInt port;
|
||||
allowedHosts = "homepage-dashboard.fi33.buzz";
|
||||
services = [
|
||||
# keep-sorted start block=yes
|
||||
{
|
||||
"Cloud Services" = [
|
||||
{
|
||||
"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/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"ntfy" = {
|
||||
"description" = "Notification service";
|
||||
"icon" = "ntfy.svg";
|
||||
"href" = "https://ntfy-sh.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Syncthing" = {
|
||||
"description" = "Decentralised file synchronisation";
|
||||
"icon" = "syncthing.svg";
|
||||
"href" = "https://syncthing.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"qBittorrent" = {
|
||||
"description" = "BitTorrent client";
|
||||
"icon" = "qbittorrent.svg";
|
||||
"href" = "https://qbittorrent.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Vaultwarden" = {
|
||||
"description" = "Password manager";
|
||||
"icon" = "vaultwarden.svg";
|
||||
"href" = "https://vaultwarden.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
"Media Management" = [
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"Prowlarr" = {
|
||||
"description" = "Indexer management tool";
|
||||
"icon" = "prowlarr.svg";
|
||||
"href" = "https://prowlarr.fi33.buzz/";
|
||||
"widget" = {
|
||||
"type" = "prowlarr";
|
||||
"url" = "https://prowlarr.fi33.buzz/";
|
||||
"key" = "@prowlarr@";
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"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@";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
"Utilities" = [
|
||||
{
|
||||
"NanoKVM" = {
|
||||
"description" = "Remote KVM switch";
|
||||
"icon" = "mdi-console.svg";
|
||||
"href" = "http://nano-kvm/";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
# keep-sorted end
|
||||
];
|
||||
settings = {
|
||||
title = "Mission Control";
|
||||
theme = "dark";
|
||||
color = "neutral";
|
||||
headerStyle = "clean";
|
||||
layout = [
|
||||
services = {
|
||||
homepage-dashboard = {
|
||||
enable = true;
|
||||
listenPort = lib.toInt port;
|
||||
allowedHosts = "homepage-dashboard.fi33.buzz";
|
||||
services = [
|
||||
# keep-sorted start block=yes
|
||||
{
|
||||
"Cloud Services" = [
|
||||
{
|
||||
"Media Streaming" = {
|
||||
style = "row";
|
||||
columns = 4;
|
||||
useEqualHeights = true;
|
||||
"copyparty" = {
|
||||
"description" = "Cloud file manager";
|
||||
"icon" = "sh-copyparty.svg";
|
||||
"href" = "https://copyparty.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Media Management" = {
|
||||
style = "row";
|
||||
columns = 4;
|
||||
useEqualHeights = true;
|
||||
"CouchDB" = {
|
||||
"description" = "Obsidian sync database";
|
||||
"icon" = "couchdb.svg";
|
||||
"href" = "https://couchdb.fi33.buzz/_utils/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Cloud Services" = {
|
||||
style = "row";
|
||||
columns = 3;
|
||||
"ntfy" = {
|
||||
"description" = "Notification service";
|
||||
"icon" = "ntfy.svg";
|
||||
"href" = "https://ntfy-sh.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Utilities" = {
|
||||
style = "row";
|
||||
columns = 3;
|
||||
"Syncthing" = {
|
||||
"description" = "Decentralised file synchronisation";
|
||||
"icon" = "syncthing.svg";
|
||||
"href" = "https://syncthing.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"qBittorrent" = {
|
||||
"description" = "BitTorrent client";
|
||||
"icon" = "qbittorrent.svg";
|
||||
"href" = "https://qbittorrent.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
{
|
||||
"Vaultwarden" = {
|
||||
"description" = "Password manager";
|
||||
"icon" = "vaultwarden.svg";
|
||||
"href" = "https://vaultwarden.fi33.buzz/";
|
||||
};
|
||||
}
|
||||
];
|
||||
quicklaunch.searchDescriptions = true;
|
||||
disableUpdateCheck = true;
|
||||
showStats = true;
|
||||
statusStyle = "dot";
|
||||
};
|
||||
widgets = [
|
||||
}
|
||||
{
|
||||
"Media Management" = [
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"Prowlarr" = {
|
||||
"description" = "Indexer management tool";
|
||||
"icon" = "prowlarr.svg";
|
||||
"href" = "https://prowlarr.fi33.buzz/";
|
||||
"widget" = {
|
||||
"type" = "prowlarr";
|
||||
"url" = "https://prowlarr.fi33.buzz/";
|
||||
"key" = "@prowlarr@";
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
"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;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"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@";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
"Utilities" = [
|
||||
{
|
||||
"NanoKVM" = {
|
||||
"description" = "Remote KVM switch";
|
||||
"icon" = "mdi-console.svg";
|
||||
"href" = "http://nano-kvm/";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
# keep-sorted end
|
||||
];
|
||||
settings = {
|
||||
title = "Mission Control";
|
||||
theme = "dark";
|
||||
color = "neutral";
|
||||
headerStyle = "clean";
|
||||
layout = [
|
||||
{
|
||||
search = {
|
||||
provider = [
|
||||
"duckduckgo"
|
||||
"brave"
|
||||
];
|
||||
focus = true;
|
||||
showSearchSuggestions = true;
|
||||
target = "_blank";
|
||||
"Media Streaming" = {
|
||||
style = "row";
|
||||
columns = 4;
|
||||
useEqualHeights = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
resources = {
|
||||
cpu = true;
|
||||
memory = true;
|
||||
disk = [
|
||||
"/"
|
||||
"/backup"
|
||||
];
|
||||
cputemp = true;
|
||||
tempmin = 0;
|
||||
tempmax = 100;
|
||||
units = "metric";
|
||||
network = true;
|
||||
uptime = true;
|
||||
"Media Management" = {
|
||||
style = "row";
|
||||
columns = 4;
|
||||
useEqualHeights = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
"Cloud Services" = {
|
||||
style = "row";
|
||||
columns = 3;
|
||||
};
|
||||
}
|
||||
{
|
||||
"Utilities" = {
|
||||
style = "row";
|
||||
columns = 3;
|
||||
};
|
||||
}
|
||||
];
|
||||
quicklaunch.searchDescriptions = true;
|
||||
disableUpdateCheck = true;
|
||||
showStats = true;
|
||||
statusStyle = "dot";
|
||||
};
|
||||
|
||||
# reverse proxy
|
||||
nginx = {
|
||||
virtualHosts."${feature}.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${port}";
|
||||
# proxyWebsockets = true;
|
||||
widgets = [
|
||||
{
|
||||
search = {
|
||||
provider = [
|
||||
"duckduckgo"
|
||||
"brave"
|
||||
];
|
||||
focus = true;
|
||||
showSearchSuggestions = true;
|
||||
target = "_blank";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
resources = {
|
||||
cpu = true;
|
||||
memory = true;
|
||||
disk = [
|
||||
"/"
|
||||
"/backup"
|
||||
];
|
||||
cputemp = true;
|
||||
tempmin = 0;
|
||||
tempmax = 100;
|
||||
units = "metric";
|
||||
network = true;
|
||||
uptime = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# secrets
|
||||
age.secrets = genSecrets secrets;
|
||||
system.activationScripts = insertSecrets secrets;
|
||||
nginx.virtualHosts."homepage-dashboard.fi33.buzz" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "fi33.buzz";
|
||||
locations."/".proxyPass = "http://localhost:${port}";
|
||||
};
|
||||
};
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
# secrets
|
||||
age.secrets = genSecrets secrets;
|
||||
system.activationScripts = insertSecrets secrets;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue