rewrote homepage to be easier to read
This commit is contained in:
parent
1ae6c88a8e
commit
e3056baa6e
@ -1,6 +1,5 @@
|
|||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
let
|
let
|
||||||
services = import ./homepage/services.nix { inherit config lib; };
|
|
||||||
cfg = config.my.servers.homepage;
|
cfg = config.my.servers.homepage;
|
||||||
setup = import ./setup.nix { inherit lib config; };
|
setup = import ./setup.nix { inherit lib config; };
|
||||||
in
|
in
|
||||||
@ -14,107 +13,14 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
listenPort = cfg.port;
|
listenPort = cfg.port;
|
||||||
environmentFile = config.sops.secrets.homepage.path;
|
environmentFile = config.sops.secrets.homepage.path;
|
||||||
settings = {
|
settings.layout = import ./homepage/layout.nix;
|
||||||
layout = {
|
widgets = import ./homepage/widgets.nix;
|
||||||
stash = {
|
services = import ./homepage/services.nix { inherit lib config; };
|
||||||
header = false;
|
|
||||||
tab = "secret";
|
|
||||||
style = "row";
|
|
||||||
};
|
|
||||||
multimedia = {
|
|
||||||
header = false;
|
|
||||||
tab = "servers";
|
|
||||||
style = "row";
|
|
||||||
columns = 4;
|
|
||||||
};
|
|
||||||
piracy = {
|
|
||||||
header = false;
|
|
||||||
tab = "servers";
|
|
||||||
style = "row";
|
|
||||||
columns = 4;
|
|
||||||
};
|
|
||||||
main = {
|
|
||||||
header = false;
|
|
||||||
tab = "servers";
|
|
||||||
style = "row";
|
|
||||||
columns = 3;
|
|
||||||
};
|
|
||||||
"server bookmarks" = {
|
|
||||||
header = false;
|
|
||||||
tab = "servers";
|
|
||||||
style = "row";
|
|
||||||
columns = 3;
|
|
||||||
};
|
|
||||||
art.tab = "bookmarks";
|
|
||||||
entertainment.tab = "bookmarks";
|
|
||||||
torrents.tab = "bookmarks";
|
|
||||||
shopping.tab = "bookmarks";
|
|
||||||
social.tab = "bookmarks";
|
|
||||||
development.tab = "bookmarks";
|
|
||||||
"secret art".tab = "secret";
|
|
||||||
"secret media".tab = "secret";
|
|
||||||
"secret social".tab = "secret";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
widgets = [
|
|
||||||
{
|
|
||||||
resources = {
|
|
||||||
cpu = true;
|
|
||||||
cputemp = true;
|
|
||||||
units = "metric";
|
|
||||||
disk = "/";
|
|
||||||
memory = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
search = {
|
|
||||||
provider = [
|
|
||||||
"brave"
|
|
||||||
"bing"
|
|
||||||
"google"
|
|
||||||
];
|
|
||||||
target = "_blank";
|
|
||||||
showSearchSuggestions = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
services = [
|
|
||||||
{ "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; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
bookmarks =
|
bookmarks =
|
||||||
let
|
builtins.readDir ./homepage/bookmarks
|
||||||
bookmarkFiles = builtins.filter (file: builtins.match ".*\\.nix" file != null) (
|
|> builtins.attrNames
|
||||||
builtins.attrNames (builtins.readDir ./homepage/bookmarks)
|
|> builtins.filter (file: builtins.match ".*\\.nix" file != null)
|
||||||
);
|
|> map (file: import ./homepage/bookmarks/${file});
|
||||||
in
|
|
||||||
map (file: import ./homepage/bookmarks/${file}) bookmarkFiles;
|
|
||||||
};
|
};
|
||||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||||
setup.proxyReverse cfg.hostName cfg.port // { }
|
setup.proxyReverse cfg.hostName cfg.port // { }
|
||||||
|
|||||||
40
modules/servers/homepage/layout.nix
Normal file
40
modules/servers/homepage/layout.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
stash = {
|
||||||
|
header = false;
|
||||||
|
tab = "secret";
|
||||||
|
style = "row";
|
||||||
|
};
|
||||||
|
multimedia = {
|
||||||
|
header = false;
|
||||||
|
tab = "servers";
|
||||||
|
style = "row";
|
||||||
|
columns = 4;
|
||||||
|
};
|
||||||
|
piracy = {
|
||||||
|
header = false;
|
||||||
|
tab = "servers";
|
||||||
|
style = "row";
|
||||||
|
columns = 4;
|
||||||
|
};
|
||||||
|
main = {
|
||||||
|
header = false;
|
||||||
|
tab = "servers";
|
||||||
|
style = "row";
|
||||||
|
columns = 3;
|
||||||
|
};
|
||||||
|
"server bookmarks" = {
|
||||||
|
header = false;
|
||||||
|
tab = "servers";
|
||||||
|
style = "row";
|
||||||
|
columns = 3;
|
||||||
|
};
|
||||||
|
art.tab = "bookmarks";
|
||||||
|
entertainment.tab = "bookmarks";
|
||||||
|
torrents.tab = "bookmarks";
|
||||||
|
shopping.tab = "bookmarks";
|
||||||
|
social.tab = "bookmarks";
|
||||||
|
development.tab = "bookmarks";
|
||||||
|
"secret art".tab = "secret";
|
||||||
|
"secret media".tab = "secret";
|
||||||
|
"secret social".tab = "secret";
|
||||||
|
}
|
||||||
243
modules/servers/homepage/service-widgets.nix
Normal file
243
modules/servers/homepage/service-widgets.nix
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
{ lib, config, ... }:
|
||||||
|
{
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,243 +1,34 @@
|
|||||||
{ config, lib, ... }:
|
{ lib, config, ... }:
|
||||||
{
|
let
|
||||||
audiobookshelf =
|
services = import ./service-widgets.nix { inherit lib config; };
|
||||||
let
|
in
|
||||||
cfg = config.my.servers.audiobookshelf;
|
[
|
||||||
in
|
{ "stash" = [ { inherit (services) stash; } ]; }
|
||||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
{
|
||||||
icon = "${cfg.name}.png";
|
"multimedia" = [
|
||||||
href = cfg.url;
|
{ inherit (services) plex; }
|
||||||
widget = {
|
{ inherit (services) jellyfin; }
|
||||||
inherit (cfg) url;
|
{ inherit (services) audiobookshelf; }
|
||||||
type = cfg.name;
|
{ inherit (services) kavita; }
|
||||||
key = "{{HOMEPAGE_VAR_AUDIOBOOKSHELF}}";
|
];
|
||||||
};
|
}
|
||||||
};
|
{
|
||||||
plex =
|
"piracy" = [
|
||||||
let
|
{ inherit (services) sonarr; }
|
||||||
cfg = config.my.servers.plex;
|
{ inherit (services) radarr; }
|
||||||
in
|
{ inherit (services) lidarr; }
|
||||||
lib.mkIf (cfg.enable || cfg.enableProxy) {
|
{ inherit (services) bazarr; }
|
||||||
icon = "${cfg.name}.png";
|
{ inherit (services) prowlarr; }
|
||||||
href = cfg.url;
|
{ inherit (services) sabnzbd; }
|
||||||
widget = {
|
{ inherit (services) "qbittorrent server"; }
|
||||||
inherit (cfg) url;
|
{ inherit (services) "qbittorrent miniserver"; }
|
||||||
type = cfg.name;
|
];
|
||||||
key = "{{HOMEPAGE_VAR_PLEX}}";
|
}
|
||||||
};
|
{
|
||||||
};
|
"main" = [
|
||||||
jellyfin =
|
{ inherit (services) nextcloud; }
|
||||||
let
|
{ inherit (services) mealie; }
|
||||||
cfg = config.my.servers.jellyfin;
|
{ inherit (services) paperless; }
|
||||||
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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
22
modules/servers/homepage/widgets.nix
Normal file
22
modules/servers/homepage/widgets.nix
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
resources = {
|
||||||
|
cpu = true;
|
||||||
|
cputemp = true;
|
||||||
|
units = "metric";
|
||||||
|
disk = "/";
|
||||||
|
memory = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
search = {
|
||||||
|
provider = [
|
||||||
|
"brave"
|
||||||
|
"bing"
|
||||||
|
"google"
|
||||||
|
];
|
||||||
|
target = "_blank";
|
||||||
|
showSearchSuggestions = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user