dotfiles/nixos/boxes/vpsfree1/cryptpad.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-19 15:47:04 +01:00
{ config, pkgs, inputs, lib, ... }:
{
2022-07-19 13:20:48 +01:00
imports = [ ../nginx.nix ];
services.nginx = {
virtualHosts = {
"notes.purrfect.estate" = {
forceSSL = true;
enableACME = true;
2022-07-19 15:47:04 +01:00
serverAliases = [ "notes-sandbox.purrfect.estate" ];
2022-07-23 07:49:40 +01:00
locations."/" = {
proxyPass = "http://localhost:9005";
proxyWebsockets = true;
};
2022-07-19 13:20:48 +01:00
};
};
};
virtualisation.oci-containers.containers.cryptpad = {
2022-07-23 07:49:40 +01:00
image = "promasu/cryptpad:nginx";
2022-07-23 08:37:53 +01:00
volumes = [
"${./cryptpad.config.js}:/cryptpad/config/config.js"
"cryptpad_blob:/cryptpad/blob"
"cryptpad_block:/cryptpad/block"
"cryptpad_customize:/cryptpad/customize"
"cryptpad_data:/cryptpad/data"
"cryptpad_data_files:/cryptpad/datastore"
];
2022-07-23 07:49:40 +01:00
environment = {
CPAD_MAIN_DOMAIN = "notes.purrfect.estate";
CPAD_SANDBOX_DOMAIN = "notes-sandbox.purrfect.estate";
CPAD_REALIP_HEADER = "X-Forwarded-For";
CPAD_REALIP_RECURSIVE = "on";
CPAD_TRUSTED_PROXY = "0.0.0.0/0";
CPAD_HTTP2_DISABLE = "true";
};
ports = [ "9005:80" ];
2022-07-19 13:20:48 +01:00
};
}