nixos-config/services/nuage.nix

40 lines
768 B
Nix
Raw Normal View History

2021-07-06 18:21:47 +02:00
{ config, lib, ... }:
let
2022-01-11 16:08:21 +01:00
inherit (lib)
mkEnableOption
mkIf
;
2021-07-06 18:21:47 +02:00
cfg = config.my.services.nuage;
my = config.my;
in
{
options.my.services.nuage = {
2022-01-11 16:08:21 +01:00
enable = mkEnableOption "Nuage redirect";
2021-07-06 18:21:47 +02:00
};
config = mkIf cfg.enable {
services.nginx.virtualHosts = {
"stratocumulus.org" = {
forceSSL = true;
enableACME = true;
locations."/".return = "301 https://petit-nuage.org";
};
"petit.stratocumulus.org" = {
forceSSL = true;
enableACME = true;
locations."/".return = "301 https://petit-nuage.org";
};
"gros.stratocumulus.org" = {
forceSSL = true;
enableACME = true;
locations."/".return = "301 https://gros-nuage.org";
};
};
};
}