{ config, pkgs, lib, ... }: with lib; let cfg = config.my.services.homer; inherit (config.my.server) domain; homeConfig = { title = "Dashboard"; header = false; footer = false; colors = { dark = { highlight-primary = "#cc241d"; highlight-secondary = "#8ec07c"; highlight-hover = "#d79921"; background = "rgb(40,36,34)"; card-background = "#3c3836"; text = "#eaeaea"; text-header = "#ffffff"; text-title = "#fafafa"; text-subtitle = "#f5f5f5"; card-shadow = "rgba(0, 0, 0, 0.4)"; link = "#3273dc"; link-hover = "#ffdd57"; }; }; connectivityCheck = true; columns = "auto"; services = config.lib.webapps.homerServices; }; in { imports = [ ./config.nix ]; options.my.services.homer = { enable = mkEnableOption "Homer Dashboard"; }; config = mkIf cfg.enable { services.caddy.virtualHosts."${domain}".extraConfig = '' handle_path /assets/config.yml { root * ${pkgs.writeText "homerConfig.yml" (builtins.toJSON homeConfig)} file_server } root * ${pkgs.homer} file_server { hide .git } ''; }; }