feat: initial homer support

This commit is contained in:
Michael Thomas 2024-05-09 12:27:42 +00:00
parent d3e4d34ea6
commit d9743ef273
3 changed files with 13 additions and 10 deletions

View File

@ -101,7 +101,7 @@
domain = "s.michaelt.xyz"; domain = "s.michaelt.xyz";
proxyIP = "10.0.10.2"; proxyIP = "10.0.10.2";
}; };
my.services.homepage-dashboard.proxy = true; my.services.homer.enable = true;
my.services.forgejo.proxy = true; my.services.forgejo.proxy = true;
services.uptime-kuma = { services.uptime-kuma = {

View File

@ -2,5 +2,6 @@
imports = [ imports = [
./forgejo ./forgejo
./homepage-dashboard ./homepage-dashboard
./homer
]; ];
} }

View File

@ -1,11 +1,13 @@
{ {
config, config,
pkgs,
lib, lib,
...
}: }:
with lib; let with lib; let
cfg = config.my.services.homer; cfg = config.my.services.homer;
inherit (my.server) domain; inherit (config.my.server) domain;
config = '' homerConfig = pkgs.writeText "homerConfig.yml" ''
--- ---
# Homepage configuration # Homepage configuration
# See https://fontawesome.com/v5/search for icons options # See https://fontawesome.com/v5/search for icons options
@ -155,18 +157,18 @@ with lib; let
# background: red # optional color for card to set color directly without custom stylesheet # background: red # optional color for card to set color directly without custom stylesheet
''; '';
in { in {
options.my.services.homer = with lib; { options.my.services.homer = {
enable = mkEnableOption "Homer Dashboard"; enable = mkEnableOption "Homer Dashboard";
}; };
config = lib.mkIf cfg.enable { config = mkIf cfg.enable {
services.caddy.virtualHosts."${domain}".extraConfig = '' services.caddy.virtualHosts."${domain}".extraConfig = ''
root * ${pkgs.homer} handle_path /assets/config.yml {
respond /assets/config.yml { root * ${homerConfig}
body file_server
${config}
end
} }
root * ${pkgs.homer}
file_server { file_server {
hide .git hide .git
} }