NixOS/modules/servers/homepage/services.nix

229 lines
5.4 KiB
Nix

{ 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}}";
};
};
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;
};
};
"now playing" =
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 = false;
enableNowPlaying = true;
showEpisodeNumber = true;
expandOneStreamToTwoRows = true;
};
};
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 = "http://${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 = "http://${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 = "http://${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"
];
};
};
}