2024-09-24 12:33:51 +02:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2023-03-08 00:48:11 +01:00
|
|
|
let
|
2024-09-24 12:33:51 +02:00
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://git.rz.ens.wtf/HackENS/hackens-orga.git";
|
|
|
|
rev = "HEAD";
|
|
|
|
hash = "sha256-BiOKGeDPVp7EV/q4S9Zc54jUeBTpfOs5e/MsCPGAk/I=";
|
|
|
|
};
|
2023-03-08 00:48:11 +01:00
|
|
|
in
|
|
|
|
{
|
2024-09-24 12:33:51 +02:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
];
|
2023-03-08 00:48:11 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
2024-06-11 14:41:49 +02:00
|
|
|
recommendedProxySettings = true;
|
2023-12-20 19:53:09 +01:00
|
|
|
virtualHosts."hackens.org" = {
|
2023-03-08 00:48:11 +01:00
|
|
|
locations = {
|
|
|
|
"/orga" = {
|
|
|
|
proxyPass = "http://localhost:51666/orga";
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_set_header SCRIPT_NAME /orga;
|
|
|
|
'';
|
|
|
|
};
|
2024-06-11 14:41:49 +02:00
|
|
|
"/static".root = config.services.django.hackens-orga.staticAssets;
|
2023-03-08 00:48:11 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-06-11 14:41:49 +02:00
|
|
|
services.django.hackens-orga = {
|
|
|
|
inherit src;
|
2023-03-08 00:48:11 +01:00
|
|
|
enable = true;
|
2024-06-11 14:41:49 +02:00
|
|
|
mainModule = "hackens_orga";
|
2023-03-08 00:48:11 +01:00
|
|
|
settings = {
|
2024-06-11 14:41:49 +02:00
|
|
|
DEBUG = false;
|
|
|
|
ALLOWED_HOSTS = [ "hackens.org" ];
|
|
|
|
DATABASES = {
|
|
|
|
"default" = {
|
|
|
|
"ENGINE" = "django.db.backends.sqlite3";
|
|
|
|
"NAME" = "/var/lib/django-hackens-orga/db.sqlite3";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-09-24 12:33:51 +02:00
|
|
|
extraPackages = p: [
|
|
|
|
p.authens
|
2024-06-11 14:41:49 +02:00
|
|
|
];
|
|
|
|
secrets = {
|
|
|
|
SECRET_KEY = config.age.secrets.django.path;
|
2023-03-08 00:48:11 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|