nixos/modules/services/nginx/applications/synapse-admin.nix

27 lines
867 B
Nix
Raw Normal View History

2023-11-07 13:27:47 +08:00
inputs:
{
options.nixos.services.nginx.applications.synapse-admin.instances =
let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{ hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; }; };}));
default = {};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications.synapse-admin) instances;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs;
in
{
2023-11-09 22:19:37 +08:00
nixos.services.nginx.https = listToAttrs (map
(site: with site.value;
2023-11-07 13:27:47 +08:00
{
name = hostname;
2023-11-15 20:42:42 +08:00
value.location."/".static =
2023-11-16 15:51:47 +08:00
{ root = "${inputs.pkgs.synapse-admin}"; index = [ "index.html" ]; };
2023-11-07 13:27:47 +08:00
})
(attrsToList instances));
};
}