1 { config, pkgs, lib, ... }:
3 cfg = config.myServices.websites.tools.cryptpad;
4 envCfg = config.myEnv.tools.cryptpad.immaeEu;
5 domain = "cryptpad.immae.eu";
7 configFile = pkgs.writeText "config.js" ''
8 // ${pkgs.cryptpad}/lib/node_modules/cryptpad/config/config.example.js
10 httpUnsafeOrigin: 'https://${domain}',
11 httpPort: ${toString port},
12 adminEmail: '${envCfg.email}',
13 filePath: './datastore/',
14 archivePath: './data/archive',
15 pinPath: './data/pins',
16 taskPath: './data/tasks',
19 blobStagingPath: './data/blobstage',
20 decreePath: './data/decrees',
21 logPath: './data/logs',
27 maxUploadSize: 100 * 1024 * 1024,
28 adminKeys: ${builtins.toJSON envCfg.admins},
33 options.myServices.websites.tools.cryptpad.enable = lib.mkEnableOption "Enable Cryptpad";
34 config = lib.mkIf cfg.enable {
35 myServices.tools.cryptpad.farm.hosts.immaeEu = {
39 services.websites.env.tools.modules = [ "proxy_wstunnel" ];
40 services.websites.env.tools.vhostConfs.cryptpad = {
44 root = config.myServices.tools.cryptpad.farm.vhostRoots.immaeEu;
46 config.myServices.tools.cryptpad.farm.vhosts.immaeEu