aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/ressourcerie_banon/cryptpad.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/ressourcerie_banon/cryptpad.nix')
-rw-r--r--modules/private/websites/ressourcerie_banon/cryptpad.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/private/websites/ressourcerie_banon/cryptpad.nix b/modules/private/websites/ressourcerie_banon/cryptpad.nix
new file mode 100644
index 0000000..961302d
--- /dev/null
+++ b/modules/private/websites/ressourcerie_banon/cryptpad.nix
@@ -0,0 +1,33 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.ressourcerie_banon.cryptpad;
4 configFile = "${pkgs.cryptpad}/lib/node_modules/cryptpad/config/config.example.js";
5in {
6 options.myServices.websites.ressourcerie_banon.cryptpad.enable = lib.mkEnableOption "Enable Ressourcerie Banon’s cryptpad";
7
8 config = lib.mkIf cfg.enable {
9 systemd.services.cryptpad-ressourcerie_banon = {
10 description = "Cryptpad Banon Service";
11 wantedBy = [ "multi-user.target" ];
12 after = [ "networking.target" ];
13 serviceConfig = {
14 DynamicUser = true;
15 Environment = [
16 "CRYPTPAD_CONFIG=${configFile}"
17 "HOME=%S/cryptpad/ressourcerie_banon"
18 ];
19 ExecStart = "${pkgs.cryptpad}/bin/cryptpad";
20 PrivateTmp = true;
21 Restart = "always";
22 StateDirectory = "cryptpad/ressourcerie_banon";
23 WorkingDirectory = "%S/cryptpad/ressourcerie_banon";
24 };
25 };
26 services.websites.env.production.vhostConfs.ressourcerie_banon_cryptpad = {
27 certName = "ressourcerie_banon";
28 addToCerts = true;
29 hosts = ["pad.le-garage-autonome.org"];
30 root = null;
31 };
32 };
33}