infrastructure/machines/nixos/web02/django-apps/kadenios.nix
Tom Hubrecht 5a37cf7d64
All checks were successful
Build all the nodes / ap01 (push) Successful in 31s
Build all the nodes / netaccess01 (push) Successful in 19s
Build all the nodes / netcore01 (push) Successful in 19s
Build all the nodes / netcore02 (push) Successful in 36s
Build all the nodes / bridge01 (push) Successful in 1m51s
Run pre-commit on all files / pre-commit (push) Successful in 24s
Build the shell / build-shell (push) Successful in 34s
Build all the nodes / build01 (push) Successful in 2m11s
Build all the nodes / hypervisor03 (push) Successful in 1m39s
Build all the nodes / geo01 (push) Successful in 2m11s
Build all the nodes / hypervisor01 (push) Successful in 2m13s
Build all the nodes / geo02 (push) Successful in 2m19s
Build all the nodes / tower01 (push) Successful in 1m44s
Build all the nodes / hypervisor02 (push) Successful in 2m22s
Build all the nodes / compute01 (push) Successful in 2m43s
Build all the nodes / vault01 (push) Successful in 1m59s
Build all the nodes / rescue01 (push) Successful in 2m20s
Build all the nodes / storage01 (push) Successful in 2m26s
Build all the nodes / web02 (push) Successful in 2m14s
Build all the nodes / web03 (push) Successful in 2m24s
Build all the nodes / web01 (push) Successful in 2m31s
feat(web02): Switch to django-apps for deploying kadenios
2025-02-24 17:47:13 +01:00

66 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";
};
};
};
}