Skip to content

Commit

Permalink
feat(nix): add parametrized homepage widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Nov 25, 2024
1 parent b07e2b0 commit 6c2a43a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 24 deletions.
67 changes: 44 additions & 23 deletions nix/modules/nixos/containers/homepage/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ in {
"traefik.sbulav.ru"
"adguard.sbulav.ru"
"flood.sbulav.ru"
"jellyfin2.sbulav.ru"
];
};

services.homepage-dashboard = {
enable = true;
# TODO: Pass secrets via services.homepage-dashboard.environmentFile
# https://gethomepage.dev/installation/docker/#using-environment-secrets
widgets = [
{
resources = {
Expand All @@ -61,50 +64,68 @@ in {
}
];
services = [
{
"My First Group" = [
{
"My First Service" = {
description = "Homepage is awesome";
href = "http://localhost/";
};
}
];
}
{
"Network" = [
{
"My Second Service" = {
description = "Homepage is the best";
href = "http://localhost/";
};
}
# TODO: implement enabling widgets based on config

{
"Traefik" = {
icon = "traefik";
href = "https://traefik.sbulav.ru";
href = "https://traefik.${config.${namespace}.containers.traefik.domain}";
widget = {
type = "traefik";
url = "https://traefik.sbulav.ru";
url = "https://traefik.${config.${namespace}.containers.traefik.domain}";
};
};
}
{
"Adguard" = {
"Adguard" = mkIf config.${namespace}.containers.adguard.enable {
icon = "adguard-home";
href = "https://adguard.sbulav.ru";
href = "https://${config.${namespace}.containers.adguard.host}";
widget = {
type = "adguard";
url = "http://${config.${namespace}.containers.adguard.localAddress}:3000";
};
};
}
];
}
{
"Media" = [
{
"nextcloud" = mkIf config.${namespace}.containers.nextcloud.enable {
icon = "nextcloud";
href = "https://${config.${namespace}.containers.nextcloud.host}";
widget = {
type = "nextcloud";
url = "https://${config.${namespace}.containers.nextcloud.host}";
};
};
}

{
"jellyfin" = {
icon = "jellyfin";
href = "https://${config.${namespace}.containers.jellyfin.host}";
widget = {
type = "jellyfin";
key = "apikey";
url = "http://${config.${namespace}.containers.jellyfin.localAddress}:8196";
enableBlocks = true; # optional, defaults to false
enableNowPlaying = true; # optional, defaults to true
enableUser = true; # optional, defaults to false
showEpisodeNumber = true; # optional, defaults to false
expandOneStreamToTwoRows = false; # optional, defaults to true
};
};
}
];
}
{
"ARR Stack" = [
{
"Flood" = {
"Flood" = mkIf config.${namespace}.containers.flood.enable {
icon = "flood";
href = "https://flood.sbulav.ru";
href = "https://${config.${namespace}.containers.flood.host}";
widget = {
type = "flood";
url = "http://${config.${namespace}.containers.flood.localAddress}:3000";
Expand Down
2 changes: 1 addition & 1 deletion nix/systems/x86_64-linux/nz/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"100.87.128.100" = ["vault-c7.pyn.ru"];
"100.91.128.100" = ["vault-c11.pyn.ru"];
"100.92.128.100" = ["vault-c12.pyn.ru"];
"192.168.89.206" = ["serverz" "jellyfin2.sbulav.ru" "authelia.sbulav.ru"];
"192.168.89.206" = ["serverz" "jellyfin2.sbulav.ru" "authelia.sbulav.ru" "homepage.sbulav.ru"];
};
networking.interfaces.wlp3s0.ipv4.routes = [
{
Expand Down

0 comments on commit 6c2a43a

Please sign in to comment.