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";
proxyIP = "10.0.10.2";
};
my.services.homepage-dashboard.proxy = true;
my.services.homer.enable = true;
my.services.forgejo.proxy = true;
services.uptime-kuma = {

View File

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

View File

@ -1,11 +1,13 @@
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.my.services.homer;
inherit (my.server) domain;
config = ''
inherit (config.my.server) domain;
homerConfig = pkgs.writeText "homerConfig.yml" ''
---
# Homepage configuration
# 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
'';
in {
options.my.services.homer = with lib; {
options.my.services.homer = {
enable = mkEnableOption "Homer Dashboard";
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
services.caddy.virtualHosts."${domain}".extraConfig = ''
root * ${pkgs.homer}
respond /assets/config.yml {
body
${config}
end
handle_path /assets/config.yml {
root * ${homerConfig}
file_server
}
root * ${pkgs.homer}
file_server {
hide .git
}