infrastructure/hosts/hydrogen/services/nginx/laurent/website.nix
2023-12-15 16:18:36 +01:00

27 lines
766 B
Nix

{pkgs, ...}: let
pages = pkgs.fetchgit {
url = "https://git.fainsin.bzh/Laurent/personal-website";
branchName = "pages";
fetchLFS = true; # https://github.com/go-gitea/gitea/issues/4773
rev = "0c6fd235e496ead9b7ba3e4e918ec4b35dd1b56b"; # pages
sha256 = "sha256-XzI6x6ms5nmnSuS9oR+xU+dLRa2ttfOHrkGxIl7M/oc=";
};
in {
services.nginx.virtualHosts = {
"laurent.fainsin.bzh" = {
enableACME = true;
forceSSL = true;
root = "${pages}";
};
"fainsin.bzh" = {
enableACME = true;
forceSSL = true;
locations."/".return = ''301 "$scheme://laurent.fainsin.bzh$request_uri"'';
};
default = {
default = true;
locations."/".return = ''301 "$scheme://laurent.fainsin.bzh" '';
};
};
}