rico2: replace homer with glance
This commit is contained in:
parent
95f35cfdf6
commit
61c055ae24
4 changed files with 28 additions and 58 deletions
|
@ -4,7 +4,7 @@ _: {
|
|||
./blocky.nix
|
||||
./forgejo-actions-runner.nix
|
||||
./grafana.nix
|
||||
./homer
|
||||
./homepage
|
||||
../../../shared/prometheus-exporters.nix
|
||||
../../../shared/promtail.nix
|
||||
];
|
||||
|
|
27
hosts/rico2/services/apps/homepage/default.nix
Normal file
27
hosts/rico2/services/apps/homepage/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{config, ...}:
|
||||
let
|
||||
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
|
||||
domainName = "homepage.labs.adtya.xyz";
|
||||
cfg = config.services.glance;
|
||||
in
|
||||
{
|
||||
services = {
|
||||
caddy = {
|
||||
virtualHosts."${domainName}" = {
|
||||
inherit logFormat;
|
||||
extraConfig = ''
|
||||
reverse_proxy ${cfg.settings.server.host}:${cfg.settings.server.port}
|
||||
'';
|
||||
};
|
||||
};
|
||||
glance = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
host = "127.0.0.1";
|
||||
port = "5678";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{ 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
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
{ 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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue