🎨 (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; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;
# disable max body size
# clientMaxBodySize = "0";
}; };
imports = [ imports = [

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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