🎨 (cesium) dry-ify a little bit the nginx n7 sites

Could be even more dry if got rid of the fetchgit precompiled pages
This commit is contained in:
Laureηt 2024-10-06 18:55:25 +02:00
parent 3e566faca6
commit a913961060
Signed by: Laurent
SSH key fingerprint: SHA256:pb5NrYg80So5z9hmqQFPmp//sgr+DFeJkKhmGyU2NLk
16 changed files with 117 additions and 76 deletions

View file

@ -6,9 +6,6 @@
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
# disable max body size
# clientMaxBodySize = "0";
};
imports = [

View file

@ -7,6 +7,7 @@
"resume.laurent.fainsin.bzh" = {
enableACME = true;
forceSSL = true;
locations = {
"/" = {
root = inputs.resume.packages.${system}.default;

View file

@ -7,17 +7,21 @@
"laurent.fainsin.bzh" = {
enableACME = true;
forceSSL = true;
locations = {
"/" = {
root = inputs.website.packages.${system}.default;
};
};
};
"fainsin.bzh" = {
enableACME = true;
forceSSL = true;
locations."/".return = ''301 "$scheme://laurent.fainsin.bzh$request_uri"'';
};
default = {
default = true;
locations."/".return = ''301 "$scheme://laurent.fainsin.bzh" '';

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/TP-calcul-parallele/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.TP-calcul-parallele.packages.${system}.report + "/";
};
services.gatus.settings.endpoints = [
{
name = "TP-calcul-parallele";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/TP-calcul-parallele/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/TP-reinforcement-learning/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.TP-reinforcement-learning.packages.${system}.notebooks + "/";
};
services.gatus.settings.endpoints = [
{
name = "TP-reinforcement-learning";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/TP-reinforcement-learning/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/TP-traitement-audio-visuel/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.TP-traitement-audio-visuel.packages.${system}.notebooks + "/";
};
services.gatus.settings.endpoints = [
{
name = "TP-traitement-audio-visuel";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/TP-traitement-audio-visuel/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,6 +1,14 @@
{...}: {
{
pkgs,
inputs,
system,
...
}: let
vhost = "n7.laurent.fainsin.bzh";
withLocation = location: {inherit inputs pkgs system vhost location;};
in {
services.nginx.virtualHosts = {
"n7.laurent.fainsin.bzh" = {
${vhost} = {
enableACME = true;
forceSSL = true;
@ -9,25 +17,25 @@
};
imports = [
./projet-audionumerique.nix
./projet-fin-etude.nix
./projet-intelligence-artificielle-multimedia.nix
./projet-long.nix
./projet-modelisation-geometrique.nix
./projet-oral-anglais.nix
./projet-oral-japonais.nix
./projet-probleme-inverse-3D.nix
./projet-systemes-algorithmes-repartis.nix
./TP-calcul-parallele.nix
./TP-reinforcement-learning.nix
./TP-traitement-audio-visuel.nix
(import ./projet-audionumerique.nix (withLocation "projet-audionumerique"))
(import ./projet-fin-etude.nix (withLocation "projet-fin-etude"))
(import ./projet-intelligence-artificielle-multimedia.nix (withLocation "projet-intelligence-artificielle-multimedia"))
(import ./projet-long.nix (withLocation "projet-long"))
(import ./projet-modelisation-geometrique.nix (withLocation "projet-modelisation-geometrique"))
(import ./projet-oral-anglais.nix (withLocation "projet-oral-anglais"))
(import ./projet-oral-japonais.nix (withLocation "projet-oral-japonais"))
(import ./projet-probleme-inverse-3D.nix (withLocation "projet-probleme-inverse-3D"))
(import ./projet-systemes-algorithmes-repartis.nix (withLocation "projet-systemes-algorithmes-repartis"))
(import ./TP-calcul-parallele.nix (withLocation "TP-calcul-parallele"))
(import ./TP-reinforcement-learning.nix (withLocation "TP-reinforcement-learning"))
(import ./TP-traitement-audio-visuel.nix (withLocation "TP-traitement-audio-visuel"))
];
services.gatus.settings.endpoints = [
{
name = "n7.laurent.fainsin.bzh";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh";
name = vhost;
group = vhost;
url = "https://${vhost}";
interval = "15m";
conditions = [
"[CERTIFICATE_EXPIRATION] > 240h"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
vhost,
location,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-audionumerique/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-audionumerique.packages.${system}.slides + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-audionumerique";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-audionumerique/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,27 +1,32 @@
{pkgs, ...}: let
{
pkgs,
vhost,
location,
...
}: let
pages = pkgs.fetchgit {
url = "https://git.fainsin.bzh/ENSEEIHT/projet-fin-etude-rapport";
rev = "32fe5c7ec6d67241951fdaf001e3da1c41b29dcf"; # pages
sha256 = "sha256-pOu0lohJ1Yqg/a5hqnNTePTrU8t5By5AbhUAJfL5MBg=";
};
in {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-fin-etude/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = "${pages}/";
index = "index.html";
tryFiles = "$uri $uri/ /projet-fin-etude/index.html";
tryFiles = "$uri $uri/ /${location}/index.html";
};
services.gatus.settings.endpoints = [
{
name = "projet-fin-etude";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-fin-etude/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"
"[RESPONSE_TIME] < 300"
"[BODY] == pat(*slidevjs/slidev*)"
"[BODY] == pat(*/projet-fin-etude/assets/index*)"
"[BODY] == pat(*/${location}/assets/index*)"
];
}
];

View file

@ -1,19 +1,19 @@
{
inputs,
system,
vhost,
location,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-intelligence-artificielle-multimedia/" = {
alias =
inputs.projet-intelligence-artificielle-multimedia.packages.${system}.slides
+ "/";
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-intelligence-artificielle-multimedia.packages.${system}.slides + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-intelligence-artificielle-multimedia";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-intelligence-artificielle-multimedia/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,11 +1,16 @@
{pkgs, ...}: let
{
pkgs,
location,
vhost,
...
}: let
pages = pkgs.fetchgit {
url = "https://git.fainsin.bzh/ENSEEIHT/projet-long";
rev = "8290710fa7461c486dc727966c8eaa2234ae2e7d"; # pages
sha256 = "1xwc0hfdn77183vvm6gadibdd0bh379192qkzf2xvidfhb8yzgqr";
};
in {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-long/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = "${pages}/";
index = "index.html";
tryFiles = "$uri $uri/ /projet-long/index.html";
@ -13,9 +18,9 @@ in {
services.gatus.settings.endpoints = [
{
name = "projet-long";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-long/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-modelisation-geometrique/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-modelisation-geometrique.packages.${system}.report + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-modelisation-geometrique";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-modelisation-geometrique/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-oral-anglais/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-oral-anglais.packages.${system}.slides + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-oral-anglais";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-oral-anglais/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-oral-japonais/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-oral-japonais.packages.${system}.slides + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-oral-japonais";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-oral-japonais/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,11 +1,16 @@
{pkgs, ...}: let
{
pkgs,
location,
vhost,
...
}: let
pages = pkgs.fetchgit {
url = "https://git.fainsin.bzh/ENSEEIHT/projet-probleme-inverse-3D";
rev = "9c75aadaf1b779e4f88fd42de163dedd8d5e918a"; # pages
sha256 = "19s8ccvarlps70aqc8njn92sbmmjbpc1d7q08hdb5apghmkplj9f";
};
in {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-probleme-inverse-3D/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = "${pages}/";
index = "index.html";
tryFiles = "$uri $uri/ /projet-probleme-inverse-3D/index.html";
@ -13,9 +18,9 @@ in {
services.gatus.settings.endpoints = [
{
name = "projet-probleme-inverse-3D";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-probleme-inverse-3D/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"

View file

@ -1,17 +1,19 @@
{
inputs,
system,
location,
vhost,
...
}: {
services.nginx.virtualHosts."n7.laurent.fainsin.bzh".locations."/projet-systemes-algorithmes-repartis/" = {
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
alias = inputs.projet-systemes-algorithmes-repartis.packages.${system}.slides + "/";
};
services.gatus.settings.endpoints = [
{
name = "projet-systemes-algorithmes-repartis";
group = "n7.laurent.fainsin.bzh";
url = "https://n7.laurent.fainsin.bzh/projet-systemes-algorithmes-repartis/";
name = location;
group = vhost;
url = "https://${vhost}/${location}/";
interval = "15m";
conditions = [
"[STATUS] == 200"