From 7c8017af030d7fab53642d38d9870d3c66807c72 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 6 Jul 2021 18:21:47 +0200 Subject: [PATCH] services: init nuage --- hosts/poseidon/default.nix | 4 ++++ services/default.nix | 1 + services/nuage.nix | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 services/nuage.nix diff --git a/hosts/poseidon/default.nix b/hosts/poseidon/default.nix index 61463f7..182ec1d 100644 --- a/hosts/poseidon/default.nix +++ b/hosts/poseidon/default.nix @@ -107,6 +107,10 @@ in enable = true; }; + nuage = { + enable = true; + }; + postgresql-backup = { enable = true; }; diff --git a/services/default.nix b/services/default.nix index bfe8f02..2ccf820 100644 --- a/services/default.nix +++ b/services/default.nix @@ -14,6 +14,7 @@ ./monitoring.nix ./nextcloud.nix ./nginx.nix + ./nuage.nix ./pipewire.nix ./postgresql-backup.nix ./postgresql.nix diff --git a/services/nuage.nix b/services/nuage.nix new file mode 100644 index 0000000..42aa36f --- /dev/null +++ b/services/nuage.nix @@ -0,0 +1,36 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.my.services.nuage; + my = config.my; +in +{ + options.my.services.nuage = { + enable = lib.mkEnableOption "Nuage redirect"; + }; + + 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"; + }; + }; + }; +}