Add mathechor-de
This commit is contained in:
parent
31eccd0f1e
commit
10c369ca16
4 changed files with 73 additions and 0 deletions
Binary file not shown.
|
@ -73,6 +73,10 @@ m-0 = {
|
||||||
server.enable = true;
|
server.enable = true;
|
||||||
standalone.enable = true;
|
standalone.enable = true;
|
||||||
git-server.enable = true;
|
git-server.enable = true;
|
||||||
|
mathechor-de = {
|
||||||
|
enable = true;
|
||||||
|
password = config.m-0.private.mathechor-pw;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users."${me.user}" = (import ./home.nix);
|
home-manager.users."${me.user}" = (import ./home.nix);
|
||||||
|
|
|
@ -8,6 +8,7 @@ in {
|
||||||
./modules/laptop.nix
|
./modules/laptop.nix
|
||||||
./modules/git-server.nix
|
./modules/git-server.nix
|
||||||
./modules/server
|
./modules/server
|
||||||
|
./modules/server/mathechor.de.nix
|
||||||
./modules/standalone
|
./modules/standalone
|
||||||
"${builtins.fetchGit "ssh://git@git.darmstadt.ccc.de/cdark.net/nixdark"}/default.nix"
|
"${builtins.fetchGit "ssh://git@git.darmstadt.ccc.de/cdark.net/nixdark"}/default.nix"
|
||||||
./modules/loginctl-linger.nix
|
./modules/loginctl-linger.nix
|
||||||
|
|
68
system/modules/server/mathechor.de.nix
Normal file
68
system/modules/server/mathechor.de.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
me = config.m-0.private.me;
|
||||||
|
page = pkgs.stdenv.mkDerivation {
|
||||||
|
name = "mathechor.de";
|
||||||
|
src = builtins.fetchGit "git@hera:mathechor.de";
|
||||||
|
buildInputs = [ pkgs.pandoc pkgs.python3 ];
|
||||||
|
LC_ALL="en_US.UTF-8";
|
||||||
|
LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r intern/output $out/intern
|
||||||
|
cp -r public/output $out/public
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
options = {
|
||||||
|
m-0.mathechor-de = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
password = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf config.m-0.mathechor-de.enable {
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
|
services = {
|
||||||
|
nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."mathechor.de" = {
|
||||||
|
serverAliases = ["www.mathechor.de"];
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
root = "${page}/public";
|
||||||
|
index = "index.html";
|
||||||
|
extraConfig = "location ~* \.(otf)$ {add_header Access-Control-Allow-Origin *;}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
virtualHosts."intern.mathechor.de" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
basicAuth.mathechor = config.m-0.mathechor-de.password;
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
root = "${page}/intern";
|
||||||
|
index = "index.html";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue