nix-config/modules/me/default.nix
2025-05-13 16:49:24 +02:00

31 lines
728 B
Nix

{
lib,
config,
...
}: let
inherit (lib) mkIf;
cfg = config.conf.website;
in
mkIf cfg.enable {
services.nginx.virtualHosts = {
${cfg.domain.me} = {
serverName = cfg.domain.me;
useACMEHost = cfg.domain.base;
forceSSL = true;
locations = {
"/" = {
return = "301 'https://${cfg.domain.me}/about.json'";
};
"/about.json" = {
return = "200 '${builtins.readFile ./about.json}'";
};
"/ssh/id_ed25519.pub" = {
return = "200 '${./id_ed25519.pub}'";
};
"/ssh/id_ed25519_sk.pub" = {
return = "200 '${./id_ed25519_sk.pub}'";
};
};
};
};
}