infrastructure/hosts/hydrogen/services/nginx/laurent/website.nix

29 lines
769 B
Nix
Raw Normal View History

{ 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 = "e29fd08e173268303d47bffbad370ade68ef35d9"; # pages
sha256 = "05jfind5bkhb0nk44sm4pzmbjh1msd30kf5xx5r6jdklx8bw1cf2";
};
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://fainsin.bzh" '';
};
};
}