infrastructure/machines/nixos/web03/django-apps/ernestophone.nix

66 lines
1.3 KiB
Nix
Raw Permalink Normal View History

# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{
pkgs,
sources,
config,
...
}:
let
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
in
{
services.django-apps.sites.ernestophone = {
source = "https://git.dgnum.eu/DGNum/ernestophone.ens.fr";
branch = "update";
domain = "ernestophone.ens.fr";
nginx = {
enableACME = true;
forceSSL = true;
locations = {
"/media/trombonoscope/".root = "/run/django-apps/ernestophone/";
};
};
serveMedia = false;
webHookSecret = config.age.secrets."webhook-ernestophone_token".path;
python = pkgs.python3.override {
packageOverrides = _: _: {
inherit (nix-pkgs)
django-avatar
django-cas-ng
django-solo
loadcredential
;
};
};
dependencies = ps: [
ps.django
ps.django-avatar
ps.django-colorful
ps.gunicorn
ps.pillow
ps.loadcredential
];
application.module = "Ernestophone";
credentials = {
SECRET_KEY = config.age.secrets."dj_ernestophone-secret_key_file".path;
};
environment = {
DJANGO_SETTINGS_MODULE = "Ernestophone.settings";
ERNESTOPHONE_ALLOWED_HOSTS = [ "ernestophone.ens.fr" ];
};
};
}