mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 18:04:41 +02:00
service/webserver: migrate nginx to caddy
This commit is contained in:
parent
13470f55e4
commit
589714db4b
34 changed files with 347 additions and 688 deletions
|
@ -26,24 +26,18 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nginx.virtualHosts = {
|
||||
# This is not a subdomain, cannot use my nginx wrapper module
|
||||
${domain} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = domain;
|
||||
# TODO: 25.05 use stable
|
||||
root = pkgs.unstable.homer;
|
||||
locations."=/assets/config.yml" = {
|
||||
alias = pkgs.writeText "homerConfig.yml" (builtins.toJSON homeConfig);
|
||||
};
|
||||
};
|
||||
# redirect any other attempt to the main site
|
||||
"${domain}-redirect" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = domain;
|
||||
default = true;
|
||||
globalRedirect = "${domain}";
|
||||
};
|
||||
# TODO: 25.05 use stable
|
||||
services.caddy.virtualHosts.${domain} = {
|
||||
extraConfig = ''
|
||||
import common
|
||||
root * ${pkgs.unstable.homer}
|
||||
file_server
|
||||
handle_path /assets/config.yml {
|
||||
root * ${pkgs.writeText "homerConfig.yml" (builtins.toJSON homeConfig)}
|
||||
file_server
|
||||
}
|
||||
'';
|
||||
useACMEHost = domain;
|
||||
};
|
||||
|
||||
webapps = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue