diff --git a/flake.lock b/flake.lock index c1456ed..6f2c5fb 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1748225455, - "narHash": "sha256-AzlJCKaM4wbEyEpV3I/PUq5mHnib2ryEy32c+qfj6xk=", + "lastModified": 1747742835, + "narHash": "sha256-kYL4GCwwznsypvsnA20oyvW8zB/Dvn6K5G/tgMjVMT4=", "owner": "nix-community", "repo": "disko", - "rev": "a894f2811e1ee8d10c50560551e50d6ab3c392ba", + "rev": "df522e787fdffc4f32ed3e1fca9ed0968a384d62", "type": "github" }, "original": { @@ -242,11 +242,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1748302896, - "narHash": "sha256-ixMT0a8mM091vSswlTORZj93WQAJsRNmEvqLL+qwTFM=", + "lastModified": 1747953325, + "narHash": "sha256-y2ZtlIlNTuVJUZCqzZAhIw5rrKP4DOSklev6c8PyCkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7848cd8c982f7740edf76ddb3b43d234cb80fc4d", + "rev": "55d1f923c480dadce40f5231feb472e81b0bab48", "type": "github" }, "original": { @@ -296,11 +296,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1748370509, - "narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=", + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4faa5f5321320e49a78ae7848582f684d64783e9", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", "type": "github" }, "original": { diff --git a/modules/services/homer/config.nix b/modules/services/homer/config.nix index b293021..ac79efe 100644 --- a/modules/services/homer/config.nix +++ b/modules/services/homer/config.nix @@ -105,46 +105,39 @@ config = let cfg = config.webapps; - appsWithName = builtins.filter (app: app.dashboard.name != null) (lib.attrValues cfg.apps); in { - lib.webapps.homerServices = lib.forEach cfg.dashboardCategories ( - category: + lib.webapps.homerServices = let - catTag = category.tag; - catApps = lib.sort (a: b: a.dashboard.name < b.dashboard.name) ( - builtins.filter ( - app: - let - cat = app.dashboard.category; - in - (cat != null && cat == catTag) || (cat == null && catTag == "misc") - ) appsWithName - ); + apps = builtins.filter (a: a.dashboard.name != null) (lib.attrValues cfg.apps); in - { - inherit (category) name; - items = lib.forEach catApps ( - app: - let - dash = app.dashboard; - in - { - inherit (dash) + lib.forEach cfg.dashboardCategories ( + cat: + let + catApps = lib.sort (a: b: a.dashboard.name < b.dashboard.name) ( + builtins.filter ( + a: + a.dashboard.category != null && a.dashboard.category == cat.tag + || a.dashboard.category == null && cat.tag == "misc" + ) apps + ); + in + { + inherit (cat) name; + items = lib.forEach catApps (a: { + inherit (a.dashboard) method name type url ; - icon = lib.optionalString (dash.icon != null) "fas fa-${dash.icon}"; + icon = lib.optionalString (a.dashboard.icon != null) "fas fa-${a.dashboard.icon}"; target = "_blank"; - } - ); - } - ); - - my.services.blackbox.http_endpoints = lib.mapAttrsToList (_: app: app.dashboard.url) cfg.apps ++ [ - "https://${config.networking.domain}/" - ]; + }); + } + ); + my.services.blackbox.http_endpoints = + lib.mapAttrsToList (_key: value: value.dashboard.url) config.webapps.apps + ++ [ "https://${config.networking.domain}/" ]; }; } diff --git a/modules/services/homer/default.nix b/modules/services/homer/default.nix index c54dec5..02ef796 100644 --- a/modules/services/homer/default.nix +++ b/modules/services/homer/default.nix @@ -10,8 +10,10 @@ let inherit (config.networking) domain; homeConfig = { + title = "Dashboard"; header = false; footer = false; + connectivityCheck = true; columns = "auto"; services = config.lib.webapps.homerServices; }; @@ -24,11 +26,18 @@ in }; config = lib.mkIf cfg.enable { - services.homer = { - enable = true; - virtualHost.caddy.enable = true; - virtualHost.domain = domain; - settings = homeConfig; + # TODO: 25.05 use stable + services.caddy.virtualHosts.${domain} = { + extraConfig = '' + import common + root * ${pkgs.unstable.homer} + file_server + handle_path /assets/config.yml { + root * ${pkgs.writeText "homerConfig.yml" (builtins.toJSON homeConfig)} + file_server + } + ''; + useACMEHost = domain; }; webapps = {