forked from DGNum/infrastructure
feat(web01): Deploy metis on calendrier.dgnum.eu
This commit is contained in:
parent
58a55c43e4
commit
1c3d44c289
4 changed files with 66 additions and 0 deletions
31
machines/web01/metis/default.nix
Normal file
31
machines/web01/metis/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ lib, pkgs, sources, ... }:
|
||||
|
||||
let
|
||||
host = "calendrier.dgnum.eu";
|
||||
|
||||
package = pkgs.callPackage ./package.nix { src = sources.metis; };
|
||||
|
||||
providers = {
|
||||
klub-reseau = "nuage.beta.rz.ens.wtf";
|
||||
eleves-ens = "cloud.eleves.ens.fr";
|
||||
frama-agenda = "framagenda.org";
|
||||
};
|
||||
in {
|
||||
services.nginx.virtualHosts.${host} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
root = package;
|
||||
|
||||
locations = lib.mapAttrs' (name: attrs:
|
||||
lib.nameValuePair "/cal/${name}/" {
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass https://${
|
||||
providers.${name}
|
||||
}/remote.php/dav/public-calendars/;
|
||||
'';
|
||||
}) providers;
|
||||
};
|
||||
}
|
23
machines/web01/metis/package.nix
Normal file
23
machines/web01/metis/package.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ lib, fetchgit, buildNpmPackage, src }:
|
||||
|
||||
buildNpmPackage {
|
||||
pname = "metis";
|
||||
version = "unstable";
|
||||
|
||||
inherit src;
|
||||
|
||||
npmDepsHash = "sha256-RbjWNVY8KlPP9ajQRnrsWhOZiiyyMGQSY39lmZnTC1I=";
|
||||
|
||||
installPhase = ''
|
||||
cp -r public $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "";
|
||||
homepage = "https://git.dgnum.eu/DGNum/metis";
|
||||
license = licenses.unfree; # FIXME: nix-init did not found a license
|
||||
maintainers = with maintainers; [ thubrecht ];
|
||||
mainProgram = "metis";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue