From bb477b36a6b3cee6a915bcd43f7e6528c340d336 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 16 Mar 2021 17:46:25 +0100 Subject: [PATCH] tgv: new service --- hosts/poseidon/default.nix | 4 ++++ services/default.nix | 1 + services/tgv.nix | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 services/tgv.nix diff --git a/hosts/poseidon/default.nix b/hosts/poseidon/default.nix index 7077116..2655868 100644 --- a/hosts/poseidon/default.nix +++ b/hosts/poseidon/default.nix @@ -118,6 +118,10 @@ in enable = true; }; + tgv = { + enable = true; + }; + transmission = { enable = true; username = "alarsyo"; diff --git a/services/default.nix b/services/default.nix index 07c86fa..3000594 100644 --- a/services/default.nix +++ b/services/default.nix @@ -13,6 +13,7 @@ ./monitoring.nix ./nginx.nix ./postgresql-backup.nix + ./tgv.nix ./transmission.nix ./wireguard.nix ]; diff --git a/services/tgv.nix b/services/tgv.nix new file mode 100644 index 0000000..eb6107e --- /dev/null +++ b/services/tgv.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.my.services.tgv; + my = config.my; +in +{ + options.my.services.tgv = { + enable = lib.mkEnableOption "TGV redirect"; + }; + + config = mkIf cfg.enable { + services.nginx.virtualHosts = { + "tgv.sexy" = { + forceSSL = true; + enableACME = true; + + locations."/".return = "301 http://www.mlgtraffic.net/"; + }; + }; + }; +}