diff --git a/home/programs/firefox/policies.nix b/home/programs/firefox/policies.nix index 4aa877e..0a06f26 100644 --- a/home/programs/firefox/policies.nix +++ b/home/programs/firefox/policies.nix @@ -53,10 +53,12 @@ in Locked = true; }; Homepage = { - StartPage = "previous-session"; + URL = "https://homepage.labs.adtya.xyz"; + StartPage = "homepage-locked"; Locked = true; }; NetworkPrediction = false; + NewTabPage = false; NoDefaultBookmarks = true; OfferToSaveLogins = false; OverrideFirstRunPage = ""; diff --git a/hosts/rico2/services/apps/default.nix b/hosts/rico2/services/apps/default.nix index 4262c9a..78cb293 100644 --- a/hosts/rico2/services/apps/default.nix +++ b/hosts/rico2/services/apps/default.nix @@ -4,6 +4,7 @@ _: { ./blocky.nix ./forgejo-actions-runner.nix ./grafana.nix + ./homer ../../../shared/prometheus-exporters.nix ../../../shared/promtail.nix ]; diff --git a/hosts/rico2/services/apps/homer/default.nix b/hosts/rico2/services/apps/homer/default.nix new file mode 100644 index 0000000..30c8436 --- /dev/null +++ b/hosts/rico2/services/apps/homer/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +let + inherit (import ../../../../shared/caddy-helpers.nix) logFormat; + domainName = "homepage.labs.adtya.xyz"; + homerPackage = pkgs.callPackage ./package.nix { }; +in +{ + services = { + caddy = { + virtualHosts."${domainName}" = { + inherit logFormat; + extraConfig = '' + handle { + root * ${homerPackage}/share/web + encode gzip + try_files {path} /index.html + file_server + } + ''; + }; + }; + }; +} diff --git a/hosts/rico2/services/apps/homer/package.nix b/hosts/rico2/services/apps/homer/package.nix new file mode 100644 index 0000000..a3819e8 --- /dev/null +++ b/hosts/rico2/services/apps/homer/package.nix @@ -0,0 +1,34 @@ +{ lib, stdenvNoCC, fetchzip, configuration ? null, styleSheet ? null }: +stdenvNoCC.mkDerivation rec { + name = "homer"; + version = "v24.10.2"; + + src = fetchzip { + url = "https://github.com/bastienwirtz/homer/releases/download/v24.10.2/homer.zip"; + sha256 = "sha256-V4E/KLOzfiCMwdQrXzab2VzjuB0TYpocoYhdUVt4g78="; + stripRoot = false; + }; + + sourceRoot = "${src.name}/"; + + configFile = + if configuration != null + then (lib.generators.toYAML { } (configuration // { stylesheet = "assets/custom.css"; })) + else "${src}/assets/config-demo.yml.dist"; + + installPhase = '' + mkdir -p $out/share/web + cp -r ./* $out/share/web/ + rm $out/share/web/assets/*.dist $out/share/web/*.sample + cp ${configFile} $out/share/web/assets/config.yml + ${lib.optionalString (styleSheet != null) "cp ${styleSheet} $out/share/web/assets/custom.css"} + ''; + + meta = { + homepage = "https://github.com/bastienwirtz/homer"; + description = "A very simple static homepage for your server"; + license = lib.licenses.asl20; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ adtya ]; + }; +} diff --git a/hosts/shared/blocky.nix b/hosts/shared/blocky.nix index d08b897..4a0543c 100644 --- a/hosts/shared/blocky.nix +++ b/hosts/shared/blocky.nix @@ -69,6 +69,7 @@ "blocky.rico1.labs.adtya.xyz" = "10.10.10.11"; "blocky.rico2.labs.adtya.xyz" = "10.10.10.12"; "grafana.labs.adtya.xyz" = "10.10.10.12"; + "homepage.labs.adtya.xyz" = "10.10.10.12"; "jackett.labs.adtya.xyz" = "10.10.10.14"; "jellyfin.labs.adtya.xyz" = "10.10.10.14"; "loki.labs.adtya.xyz" = "10.10.10.11";