67 lines
1.5 KiB
Nix
67 lines
1.5 KiB
Nix
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
||
|
#
|
||
|
# SPDX-License-Identifier: EUPL-1.2
|
||
|
|
||
|
{ config, ... }:
|
||
|
|
||
|
{
|
||
|
services.django-apps.sites.kadenios = {
|
||
|
source = "https://git.dgnum.eu/DGNum/kadenios";
|
||
|
branch = "production";
|
||
|
domain = "vote.dgnum.eu";
|
||
|
|
||
|
nginx = {
|
||
|
enableACME = true;
|
||
|
forceSSL = true;
|
||
|
};
|
||
|
|
||
|
webHookSecret = config.age.secrets."webhook-kadenios_token".path;
|
||
|
|
||
|
overlays.nix-pkgs = [
|
||
|
# Required packages
|
||
|
"authens"
|
||
|
"django-background-tasks"
|
||
|
"django-bulma-forms"
|
||
|
"django-translated-fields"
|
||
|
"loadcredential"
|
||
|
|
||
|
# Dependencies
|
||
|
"python-cas"
|
||
|
];
|
||
|
|
||
|
dependencies = ps: [
|
||
|
ps.authens
|
||
|
ps.django
|
||
|
ps.django-background-tasks
|
||
|
ps.django-bulma-forms
|
||
|
ps.django-translated-fields
|
||
|
ps.gunicorn
|
||
|
ps.loadcredential
|
||
|
ps.markdown
|
||
|
ps.networkx
|
||
|
ps.numpy
|
||
|
ps.psycopg
|
||
|
];
|
||
|
|
||
|
environment = {
|
||
|
KADENIOS_EMAIL_HOST_USER = "web-services@infra.dgnum.eu";
|
||
|
KADENIOS_EMAIL_USE_SSL = true;
|
||
|
KADENIOS_FROM_EMAIL = "Kadenios <vote@infra.dgnum.eu>";
|
||
|
KADENIOS_SERVER_EMAIL = "kadenios@infra.dgnum.eu";
|
||
|
};
|
||
|
|
||
|
credentials = {
|
||
|
SECRET_KEY = config.age.secrets."dj_kadenios-secret_key_file".path;
|
||
|
EMAIL_HOST_PASSWORD = config.age.secrets."dj_kadenios-email_password_file".path;
|
||
|
};
|
||
|
|
||
|
extraServices.tasks = {
|
||
|
script = "python3 manage.py process_tasks";
|
||
|
|
||
|
serviceConfig = {
|
||
|
WorkingDirectory = "/var/lib/django-apps/kadenios/source";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|