From 6d277b681443903a835d865c1ed55175858238f8 Mon Sep 17 00:00:00 2001 From: quitte Date: Thu, 28 Sep 2023 13:34:58 +0200 Subject: [PATCH] courses-phil: add redirects --- modules/course-management.nix | 18 ++++++++++++++++++ modules/courses-phil.nix | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/course-management.nix b/modules/course-management.nix index 88cbc3b..d5ed99a 100644 --- a/modules/course-management.nix +++ b/modules/course-management.nix @@ -48,5 +48,23 @@ in services.nginx.virtualHosts.${hostName} = { enableACME = true; forceSSL = true; + + # phil redirects + locations = + let + philDomain = "https://kurse-phil.ifsr.de"; + courses = [ "238" "239" "240" "241" "242" "243" ]; + subjects = [ + "ESE 2023 PHIL Campustour" + "ESE 2023 PHIL Bowlingabend" + "ESE 2023 PHIL Filmabend" + "ESE 2023 PHIL Wandern" + "ESE 2023 PHIL Spieleabend Pen and Paper" + ]; + in + { + "~ \"^/course/(${builtins.concatStringsSep "|" courses})/\"".return = "301 ${philDomain}/course/$1"; + "~ \"^/subject/(${builtins.concatStringsSep "|" subjects})/\"".return = "301 ${philDomain}/subject/$1"; + }; }; } diff --git a/modules/courses-phil.nix b/modules/courses-phil.nix index 3dc0058..e7dd979 100644 --- a/modules/courses-phil.nix +++ b/modules/courses-phil.nix @@ -1,6 +1,6 @@ { config, lib, sops-nix, course-management, ... }: let - hostName = "phil.${config.networking.domain}"; + hostName = "kurse-phil.${config.networking.domain}"; in { services.nginx.virtualHosts."${hostName}" = { @@ -17,6 +17,7 @@ in # mountPoint = "/etc/ssh"; # }; config = { pkgs, config, ... }: { + system.stateVersion = "23.05"; networking.domain = "ifsr.de"; imports = [ sops-nix.nixosModules.sops