feat: initial homer support
This commit is contained in:
parent
d3e4d34ea6
commit
d9743ef273
@ -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 = {
|
||||
|
@ -2,5 +2,6 @@
|
||||
imports = [
|
||||
./forgejo
|
||||
./homepage-dashboard
|
||||
./homer
|
||||
];
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user