From 4ee6301abe360fb9f5b79656d4a390bad46d21d4 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sat, 19 Oct 2024 18:20:50 +0200 Subject: [PATCH] added homepage dashboard. --- configs/nixos/homepage.nix | 122 +++++++++++++++++++++++++++++++++++++ flake.nix | 2 +- hosts/cirrus/default.nix | 1 + 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 configs/nixos/homepage.nix diff --git a/configs/nixos/homepage.nix b/configs/nixos/homepage.nix new file mode 100644 index 0000000..c2bd72a --- /dev/null +++ b/configs/nixos/homepage.nix @@ -0,0 +1,122 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: let + cfg = config.services.homepage-dashboard; + baseurl = "homepage.venberg.xyz"; +in { + services.homepage-dashboard = { + enable = true; + settings = { + theme = "dark"; + color = "slate"; + headerStyle = "boxed"; + base = "https://${baseurl}"; + language = "en"; + hideVersion=true; + statusStyle = "dot"; + quicklaunch = { + searchDescriptions = true; + hideInternetSearch = false; + hideVisitUrl = false; + provider="duckduckgo"; + }; + }; + + widgets = [ + { + datetime = { + text_size = "x2"; + locale = "en-CA"; + format = { + hourCycle = "h23"; + hour12 = false; + year = "numeric"; + month = "numeric"; + day = "numeric"; + hour = "numeric"; + minute = "numeric"; + }; + }; + } + { + resources = { + cpu = true; + disk = "/"; + memory = true; + }; + } + { + openmeteo = { + label = "Current"; + units = "metric"; + cache = 5; + }; + } + { + openmeteo = { + label = "Mainz"; + timezone = "Europe/Berlin"; + units = "metric"; + cache = 5; + latitude = 49.999444; + longitude = 8.273611; + }; + } + ]; + + services = [ + { + Family = [ + { + Jellyfin = { + icon = "sh-jellyfin.svg"; + href = "https://media.venberg.xyz"; + siteMonitor = "https://media.venberg.xyz"; + description = "Movies"; + }; + } + { + Grocy = { + icon = "sh-grocy.svg"; + href = "https://grocy.venberg.xyz"; + siteMonitor = "https://grocy.venberg.xyz"; + description = "Family ERP"; + }; + } + { + Radicale={ + icon="sh-radicale.svg"; + href="https://cal.venberg.xyz"; + siteMonitor="https://cal.venberg.xyz"; + description="Calander administration"; + }; + } + ]; + } + { + Development = [ + { + Forgejo = { + icon = "sh-forgejo.svg"; + href = "https://git.venberg.xyz"; + siteMonitor = "https://git.venberg.xyz"; + description = "Self hosted Git forge."; + }; + } + ]; + } + ]; + }; + + services.nginx.virtualHosts.${baseurl} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:${toString cfg.listenPort}"; + }; + }; +} diff --git a/flake.nix b/flake.nix index 4670bcb..073f9b5 100644 --- a/flake.nix +++ b/flake.nix @@ -111,7 +111,7 @@ remoteBuild = true; }; cirrus = { - hostname = "cal.venberg.xyz"; + hostname = "cirrus"; profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cirrus; }; cirrostratus = { diff --git a/hosts/cirrus/default.nix b/hosts/cirrus/default.nix index 91d4057..6c6fd95 100644 --- a/hosts/cirrus/default.nix +++ b/hosts/cirrus/default.nix @@ -20,6 +20,7 @@ inputs.nixpkgs.lib.nixosSystem { ../../configs/nixos/secrets.nix ../../configs/nixos/radicale.nix ../../configs/nixos/forgejo.nix + ../../configs/nixos/homepage.nix ({ config, pkgs,