nixos-config/services/tgv.nix

30 lines
449 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-03-16 17:46:25 +01:00
cfg = config.my.services.tgv;
my = config.my;
2022-04-10 11:54:58 +02:00
in {
2021-03-16 17:46:25 +01:00
options.my.services.tgv = {
2022-01-11 16:08:21 +01:00
enable = mkEnableOption "TGV redirect";
2021-03-16 17:46:25 +01:00
};
config = mkIf cfg.enable {
services.nginx.virtualHosts = {
"tgv.sexy" = {
forceSSL = true;
enableACME = true;
locations."/".return = "301 http://www.mlgtraffic.net/";
};
};
};
}