From 2bb03126cf5b1f16ddb03aaff4a2fc9262821efa Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 22 Oct 2024 14:19:58 +0200 Subject: [PATCH] feat(web03): Deploy django-wiki on wiki.webapps.dgnum.eu --- machines/web03/django-apps/default.nix | 1 + machines/web03/django-apps/wikiens.nix | 40 ++++++++++++++++++++++++++ npins/sources.json | 6 ++-- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 machines/web03/django-apps/wikiens.nix diff --git a/machines/web03/django-apps/default.nix b/machines/web03/django-apps/default.nix index 9b42eab..5c0760c 100644 --- a/machines/web03/django-apps/default.nix +++ b/machines/web03/django-apps/default.nix @@ -2,6 +2,7 @@ imports = [ ./annuaire.nix ./gestiojeux.nix + ./wikiens.nix ]; services.django-apps = { diff --git a/machines/web03/django-apps/wikiens.nix b/machines/web03/django-apps/wikiens.nix new file mode 100644 index 0000000..5d36903 --- /dev/null +++ b/machines/web03/django-apps/wikiens.nix @@ -0,0 +1,40 @@ +{ pkgs, sources, ... }: + +let + nix-pkgs = import sources.nix-pkgs { inherit pkgs; }; +in + +{ + services.django-apps.sites.wikiens = { + source = "https://git.dgnum.eu/DGNum/wiki-eleves"; + branch = "main"; + domain = "wiki.webapps.dgnum.eu"; + + nginx = { + enableACME = true; + forceSSL = true; + }; + + webHookSecret = builtins.toFile "insecure-secret" "T5hNeDraMivRZLUkrekv&QeM"; + + python = pkgs.python3.override { + packageOverrides = _: _: { inherit (nix-pkgs) django-allauth-ens django-wiki loadcredential; }; + }; + + dependencies = ps: [ + ps.django + ps.django-allauth-ens + ps.django-wiki + ps.loadcredential + ps.tinycss2 + ]; + + credentials = { + SECRET_KEY = builtins.toFile "insecure-key" "insecure-key"; + }; + + environment = { + WIKIENS_ALLOWED_HOSTS = [ "wiki.webapps.dgnum.eu" ]; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 7a1c44f..0b8561f 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -226,9 +226,9 @@ "url": "https://git.hubrecht.ovh/hubrecht/nix-pkgs" }, "branch": "main", - "revision": "0e80d4dcdd54a75556c0784de55dc139ad4fe797", + "revision": "6f56463c0034d4162dabb98ee8e70d6c43214ac0", "url": null, - "hash": "1hlb0cczxq0jrzw4lhmkibnb8skcar0rmny594aqgyikknwzx2qf" + "hash": "0dqm2n88f0yl63wacizwpjrcv51arz5z31nhwbjcbyjxrwiwxamq" }, "nixos-24.05": { "type": "Channel", @@ -308,4 +308,4 @@ } }, "version": 3 -} +} \ No newline at end of file