54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
src = pkgs.fetchgit {
|
|
url = "https://git.rz.ens.wtf/HackENS/hackens-orga.git";
|
|
rev = "HEAD";
|
|
hash = "sha256-BiOKGeDPVp7EV/q4S9Zc54jUeBTpfOs5e/MsCPGAk/I=";
|
|
};
|
|
in
|
|
{
|
|
imports =
|
|
[
|
|
];
|
|
services.nginx = {
|
|
enable = true;
|
|
recommendedProxySettings = true;
|
|
virtualHosts."hackens.org" = {
|
|
locations = {
|
|
"/orga" = {
|
|
proxyPass = "http://localhost:51666/orga";
|
|
extraConfig = ''
|
|
proxy_set_header SCRIPT_NAME /orga;
|
|
'';
|
|
};
|
|
"/static".root = config.services.django.hackens-orga.staticAssets;
|
|
};
|
|
};
|
|
};
|
|
services.django.hackens-orga = {
|
|
inherit src;
|
|
enable = true;
|
|
mainModule = "hackens_orga";
|
|
settings = {
|
|
DEBUG = false;
|
|
ALLOWED_HOSTS = [ "hackens.org" ];
|
|
DATABASES = {
|
|
"default" = {
|
|
"ENGINE" = "django.db.backends.sqlite3";
|
|
"NAME" = "/var/lib/django-hackens-orga/db.sqlite3";
|
|
};
|
|
};
|
|
};
|
|
extraPackages = p: [
|
|
p.authens
|
|
];
|
|
secrets = {
|
|
SECRET_KEY = config.age.secrets.django.path;
|
|
};
|
|
};
|
|
}
|