rewrote homepage to be easier to read
This commit is contained in:
@@ -1,243 +1,34 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
audiobookshelf =
|
||||
let
|
||||
cfg = config.my.servers.audiobookshelf;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_AUDIOBOOKSHELF}}";
|
||||
};
|
||||
};
|
||||
plex =
|
||||
let
|
||||
cfg = config.my.servers.plex;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_PLEX}}";
|
||||
};
|
||||
};
|
||||
jellyfin =
|
||||
let
|
||||
cfg = config.my.servers.jellyfin;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_JELLYFIN}}";
|
||||
enableUser = true;
|
||||
enableBlocks = true;
|
||||
enableNowPlaying = false;
|
||||
};
|
||||
};
|
||||
sonarr =
|
||||
let
|
||||
cfg = config.my.servers.sonarr;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_SONARR}}";
|
||||
enableQueue = true;
|
||||
};
|
||||
};
|
||||
radarr =
|
||||
let
|
||||
cfg = config.my.servers.radarr;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_RADARR}}";
|
||||
enableQueue = true;
|
||||
};
|
||||
};
|
||||
lidarr =
|
||||
let
|
||||
cfg = config.my.servers.lidarr;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_LIDARR}}";
|
||||
};
|
||||
};
|
||||
prowlarr =
|
||||
let
|
||||
cfg = config.my.servers.prowlarr;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
type = cfg.name;
|
||||
inherit (cfg) url;
|
||||
key = "{{HOMEPAGE_VAR_PROWLARR}}";
|
||||
};
|
||||
};
|
||||
bazarr =
|
||||
let
|
||||
cfg = config.my.servers.bazarr;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
type = cfg.name;
|
||||
inherit (cfg) url;
|
||||
key = "{{HOMEPAGE_VAR_BAZARR}}";
|
||||
};
|
||||
};
|
||||
kavita =
|
||||
let
|
||||
cfg = config.my.servers.kavita;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
type = cfg.name;
|
||||
inherit (cfg) url;
|
||||
username = "{{HOMEPAGE_VAR_KAVITA_USERNAME}}";
|
||||
password = "{{HOMEPAGE_VAR_KAVITA_PASSWORD}}";
|
||||
};
|
||||
};
|
||||
"qbittorrent server" =
|
||||
let
|
||||
url = "https://${config.my.ips.server}:${toString config.my.servers.qbittorrent.port}";
|
||||
name = "qbittorrent";
|
||||
in
|
||||
lib.mkIf config.my.servers.qbittorrent.enable {
|
||||
icon = "${name}.png";
|
||||
href = url;
|
||||
widget = {
|
||||
type = name;
|
||||
inherit url;
|
||||
username = "{{HOMEPAGE_VAR_QBIT_USERNAME}}";
|
||||
password = "{{HOMEPAGE_VAR_QBIT_PASSWORD}}";
|
||||
};
|
||||
};
|
||||
"qbittorrent miniserver" =
|
||||
let
|
||||
url = "https://${config.my.ips.miniserver}:${toString config.my.servers.qbittorrent.port}";
|
||||
name = "qbittorrent";
|
||||
in
|
||||
lib.mkIf config.my.servers.qbittorrent.enable {
|
||||
icon = "${name}.png";
|
||||
href = url;
|
||||
widget = {
|
||||
type = name;
|
||||
inherit url;
|
||||
username = "{{HOMEPAGE_VAR_QBIT_USERNAME}}";
|
||||
password = "{{HOMEPAGE_VAR_QBIT_PASSWORD}}";
|
||||
};
|
||||
};
|
||||
sabnzbd =
|
||||
let
|
||||
name = "sabnzbd";
|
||||
url = "https://${config.my.ips.server}:${toString config.my.servers.sabnzbd.port}";
|
||||
in
|
||||
{
|
||||
icon = "${name}.png";
|
||||
href = url;
|
||||
widget = {
|
||||
type = name;
|
||||
inherit url;
|
||||
key = "{{HOMEPAGE_VAR_SABNZBD}}";
|
||||
};
|
||||
};
|
||||
mealie =
|
||||
let
|
||||
cfg = config.my.servers.mealie;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
key = "{{HOMEPAGE_VAR_MEALIE}}";
|
||||
version = 2;
|
||||
};
|
||||
};
|
||||
nextcloud =
|
||||
let
|
||||
cfg = config.my.servers.nextcloud;
|
||||
in
|
||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
||||
icon = "${cfg.name}.png";
|
||||
href = cfg.url;
|
||||
widget = {
|
||||
inherit (cfg) url;
|
||||
type = cfg.name;
|
||||
username = "{{HOMEPAGE_VAR_NEXTCLOUD_USERNAME}}";
|
||||
password = "{{HOMEPAGE_VAR_NEXTCLOUD_PASSWORD}}";
|
||||
token = "{{HOMEPAGE_VAR_NEXTCLOUD_TOKEN}}";
|
||||
fields = [
|
||||
"memoryusage"
|
||||
"activeusers"
|
||||
"numfiles"
|
||||
"numshares"
|
||||
];
|
||||
};
|
||||
};
|
||||
paperless =
|
||||
let
|
||||
name = "paperlessngx";
|
||||
url = "http://${config.my.ips.miniserver}:${toString config.services.paperless.port}";
|
||||
in
|
||||
lib.mkIf config.my.servers.paperless.enable {
|
||||
icon = "paperless.png";
|
||||
href = url;
|
||||
widget = {
|
||||
type = name;
|
||||
key = "{{HOMEPAGE_VAR_PAPERLESS}}";
|
||||
inherit url;
|
||||
fields = [
|
||||
"total"
|
||||
"inbox"
|
||||
];
|
||||
};
|
||||
};
|
||||
stash =
|
||||
let
|
||||
name = "stash";
|
||||
url = "http://192.168.1.69:9999";
|
||||
in
|
||||
{
|
||||
icon = "${name}.png";
|
||||
href = url;
|
||||
widget = {
|
||||
type = name;
|
||||
key = "{{HOMEPAGE_VAR_STASH}}";
|
||||
inherit url;
|
||||
fields = [
|
||||
"scenes"
|
||||
"images"
|
||||
"playCount"
|
||||
"oCount"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
services = import ./service-widgets.nix { inherit lib config; };
|
||||
in
|
||||
[
|
||||
{ "stash" = [ { inherit (services) stash; } ]; }
|
||||
{
|
||||
"multimedia" = [
|
||||
{ inherit (services) plex; }
|
||||
{ inherit (services) jellyfin; }
|
||||
{ inherit (services) audiobookshelf; }
|
||||
{ inherit (services) kavita; }
|
||||
];
|
||||
}
|
||||
{
|
||||
"piracy" = [
|
||||
{ inherit (services) sonarr; }
|
||||
{ inherit (services) radarr; }
|
||||
{ inherit (services) lidarr; }
|
||||
{ inherit (services) bazarr; }
|
||||
{ inherit (services) prowlarr; }
|
||||
{ inherit (services) sabnzbd; }
|
||||
{ inherit (services) "qbittorrent server"; }
|
||||
{ inherit (services) "qbittorrent miniserver"; }
|
||||
];
|
||||
}
|
||||
{
|
||||
"main" = [
|
||||
{ inherit (services) nextcloud; }
|
||||
{ inherit (services) mealie; }
|
||||
{ inherit (services) paperless; }
|
||||
];
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user