From d85f79d1f79dc7f4256f8060f8c4c1df1887aa04 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 5 Jan 2025 19:28:38 +0400 Subject: [PATCH] homepage --- hosts/sakoserver/configuration.nix | 5 ++- modules/server/services/local/default.nix | 2 +- .../services/local/homepage/default.nix | 41 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 modules/server/services/local/homepage/default.nix diff --git a/hosts/sakoserver/configuration.nix b/hosts/sakoserver/configuration.nix index eb0be97a..4b8cfe2d 100644 --- a/hosts/sakoserver/configuration.nix +++ b/hosts/sakoserver/configuration.nix @@ -97,7 +97,10 @@ }; headscale.enable = true; redlib.enable = true; - local = { nextcloud.enable = false; }; + local = { + homepage.enable = true; + nextcloud.enable = false; + }; }; fedi = { akkoma.enable = true; }; media = { diff --git a/modules/server/services/local/default.nix b/modules/server/services/local/default.nix index a3ca3676..849d7c74 100644 --- a/modules/server/services/local/default.nix +++ b/modules/server/services/local/default.nix @@ -1 +1 @@ -{ imports = [ ./nextcloud ]; } +{ imports = [ ./nextcloud ./homepage ]; } diff --git a/modules/server/services/local/homepage/default.nix b/modules/server/services/local/homepage/default.nix new file mode 100644 index 00000000..df57f350 --- /dev/null +++ b/modules/server/services/local/homepage/default.nix @@ -0,0 +1,41 @@ +{ config, pkgs, lib, ... }: +with lib; +let + inherit (lib) mkIf; + cfg = config.void.server.services.local.homepage; + srv = config.void.server; +in { + options.void.server.services.local.homepage = { + enable = mkEnableOption false; + }; + + config = mkIf cfg.enable { + services = { + nginx.virtualHosts."sako.box" = { + forceSSL = true; + sslCertificate = "/srv/secrets/certs/sako.box.pem"; + sslCertificateKey = "/srv/secrets/certs/sako.box-key.pem"; + locations."/" = { proxyPass = "http://localhost:8082"; }; + }; + homepage-dashboard = { + enable = true; + widgets = [{ + resources = { + cpu = true; + disk = "/"; + memory = true; + }; + }]; + services = [{ + "Media" = [{ + "Jellyfin" = mkIf srv.media.jellyfin.enable { + description = "Media server"; + href = "https://jellyfin.sako.box"; + }; + }]; + }]; + }; + }; + }; + +}