2024-11-12 10:39:28 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
sources,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
services.django-apps.sites.interludes = {
|
|
|
|
source = "https://git.eleves.ens.fr/dlesbre/site-interludes";
|
|
|
|
branch = "master";
|
2024-11-12 14:55:04 +01:00
|
|
|
domain = "interludes.ens.fr";
|
2024-11-12 10:39:28 +01:00
|
|
|
|
|
|
|
nginx = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
webHookSecret = builtins.toFile "insecure-secret" "T5hNeDraMivRZLUkrekv&QeM";
|
|
|
|
|
|
|
|
application = {
|
|
|
|
type = "wsgi";
|
|
|
|
module = "interludes";
|
|
|
|
};
|
|
|
|
|
|
|
|
dbType = "sqlite";
|
|
|
|
|
|
|
|
python = pkgs.python3.override {
|
|
|
|
packageOverrides = _: _: { inherit (nix-pkgs) python-cas loadcredential; };
|
|
|
|
};
|
|
|
|
|
|
|
|
django = ps: ps.django_4;
|
|
|
|
dependencies = ps: [
|
|
|
|
ps.loadcredential
|
|
|
|
ps.python-ldap
|
|
|
|
ps.python-cas
|
|
|
|
];
|
|
|
|
|
|
|
|
credentials = {
|
|
|
|
SECRET_KEY = config.age.secrets."dj_interludes-secret_key_file".path;
|
|
|
|
EMAIL_HOST_PASSWORD = config.age.secrets."dj_interludes-email_host_password_file".path;
|
|
|
|
};
|
|
|
|
|
|
|
|
environment = {
|
2024-11-12 14:55:04 +01:00
|
|
|
INTERLUDES_ALLOWED_HOSTS = [ "interludes.ens.fr" ];
|
2024-11-12 10:39:28 +01:00
|
|
|
|
|
|
|
# E-mail configuration
|
|
|
|
INTERLUDES_SERVER_EMAIL = "noreply-interludes-admin@ens.fr";
|
|
|
|
INTERLUDES_DEFAULT_FROM_EMAIL = "noreply-interludes@ens.fr";
|
|
|
|
INTERLUDES_EMAIL_HOST = "clipper.ens.fr";
|
|
|
|
INTERLUDES_EMAIL_PORT = 465;
|
|
|
|
INTERLUDES_EMAIL_HOST_USER = "interludes";
|
2024-11-12 10:52:49 +01:00
|
|
|
INTERLUDES_DEBUG = false;
|
2024-11-12 10:39:28 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|