From 1f1f82c7ccbbe0d9a01cc8d5e7f38f3e32565237 Mon Sep 17 00:00:00 2001 From: tux Date: Fri, 7 Mar 2025 05:33:29 +0530 Subject: [PATCH] feat: add glance --- hosts/homelab/default.nix | 1 + modules/nixos/selfhosted/glance/default.nix | 38 +++++++++ modules/nixos/selfhosted/glance/home.nix | 86 +++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 modules/nixos/selfhosted/glance/default.nix create mode 100644 modules/nixos/selfhosted/glance/home.nix diff --git a/hosts/homelab/default.nix b/hosts/homelab/default.nix index fda47c2..4dddd94 100755 --- a/hosts/homelab/default.nix +++ b/hosts/homelab/default.nix @@ -16,6 +16,7 @@ ../../modules/nixos/desktop ../../modules/nixos/virtualisation/docker.nix ../../modules/nixos/selfhosted/open-webui.nix + ../../modules/nixos/selfhosted/glance ]; tux.services.openssh.enable = true; diff --git a/modules/nixos/selfhosted/glance/default.nix b/modules/nixos/selfhosted/glance/default.nix new file mode 100644 index 0000000..ca263a0 --- /dev/null +++ b/modules/nixos/selfhosted/glance/default.nix @@ -0,0 +1,38 @@ +{username, ...}: let + home = import ./home.nix; +in { + services = { + glance = { + enable = true; + openFirewall = true; + settings = { + server = { + host = "0.0.0.0"; + port = 5678; + }; + branding = { + custom-footer = "

${username}

"; + }; + pages = [ + home.page + ]; + }; + }; + + # nginx = { + # enable = lib.mkForce true; + # virtualHosts = { + # "dashboard.tux.rs" = { + # forceSSL = true; + # useACMEHost = "tux.rs"; + # locations = { + # "/" = { + # proxyPass = "http://${config.services.glance.settings.server.host}:${toString config.services.glance.settings.server.port}"; + # proxyWebsockets = true; + # }; + # }; + # }; + # }; + # }; + }; +} diff --git a/modules/nixos/selfhosted/glance/home.nix b/modules/nixos/selfhosted/glance/home.nix new file mode 100644 index 0000000..2b7bdb9 --- /dev/null +++ b/modules/nixos/selfhosted/glance/home.nix @@ -0,0 +1,86 @@ +{ + page = { + name = "Dashboard - tux"; + width = "slim"; + hide-desktop-navigation = true; + center-vertically = true; + columns = [ + { + size = "full"; + widgets = [ + { + type = "search"; + autofocus = true; + } + { + type = "markets"; + markets = [ + { + symbol = "BTC-USD"; + name = "Bitcoin"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:BTCUSD"; + } + { + symbol = "ETH-USD"; + name = "Ethereum"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:ETHUSD"; + } + { + symbol = "SOL-USD"; + name = "Solana"; + chart-link = "https://www.tradingview.com/chart/?symbol=INDEX:SOLUSD"; + } + ]; + } + { + type = "monitor"; + cache = "1m"; + title = "Services"; + sites = [ + { + title = "Gitea"; + url = "https://git.tux.rs"; + icon = "si:gitea"; + } + { + title = "Vaultwarden"; + url = "https://bw.tux.rs"; + icon = "si:vaultwarden"; + } + { + title = "Ntfy"; + url = "https://ntfy.tux.rs"; + icon = "si:ntfy"; + } + { + title = "Grafana"; + url = "https://grafana.tux.rs"; + icon = "si:grafana"; + } + { + title = "SearXNG"; + url = "https://sx.tux.rs"; + icon = "si:searxng"; + } + { + title = "Wakapi"; + url = "https://wakapi.tux.rs"; + icon = "si:wakatime"; + } + ]; + } + { + type = "reddit"; + subreddit = "selfhosted"; + style = "horizontal-cards"; + } + { + type = "reddit"; + subreddit = "homelab"; + style = "horizontal-cards"; + } + ]; + } + ]; + }; +}