diff --git a/devices/ellaca/options.nix b/devices/ellaca/options.nix index c132b6c..148a31e 100644 --- a/devices/ellaca/options.nix +++ b/devices/ellaca/options.nix @@ -32,6 +32,7 @@ in { domain = { full = web-domain; base = web-domain; + me = "me.${web-domain}"; }; }; diff --git a/modules/me/default.nix b/modules/me/default.nix new file mode 100644 index 0000000..7c9374a --- /dev/null +++ b/modules/me/default.nix @@ -0,0 +1,29 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf; + cfg = config.conf.website; + me = { + name = "mira"; + }; +in + mkIf cfg.enable { + services.nginx.virtualHosts = { + ${cfg.domain.me} = { + default = true; + serverName = cfg.domain.me; + useACMEHost = cfg.domain.base; + forceSSL = true; + locations = { + "/about.json" = { + return = builtins.toJson me; + extraConfig = '' + default_type application/json; + ''; + }; + }; + }; + }; + } diff --git a/options.nix b/options.nix index fcc3b87..46aceb8 100644 --- a/options.nix +++ b/options.nix @@ -184,6 +184,10 @@ in { type = nullOr str; default = null; }; + me = mkOption { + type = nullOr str; + default = null; + }; }; };