nixos-config/services/nuage.nix

42 lines
779 B
Nix
Raw Normal View History

2022-04-10 11:54:58 +02:00
{
config,
lib,
...
}: let
inherit
(lib)
2022-01-11 16:08:21 +01:00
mkEnableOption
mkIf
2022-04-10 11:54:58 +02:00
;
2022-01-11 16:08:21 +01:00
2021-07-06 18:21:47 +02:00
cfg = config.my.services.nuage;
my = config.my;
2022-04-10 11:54:58 +02:00
in {
2021-07-06 18:21:47 +02:00
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";
};
};
};
}