dotfiles/nixos/boxes/vpsfree1/cryptpad.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-19 15:47:04 +01:00
{
2022-12-19 09:09:08 +00:00
config,
pkgs,
inputs,
lib,
...
}: {
imports = [../nginx.nix];
2022-07-19 13:20:48 +01:00
services.nginx = {
virtualHosts = {
"notes.purrfect.estate" = {
forceSSL = true;
enableACME = true;
2022-12-19 09:09:08 +00:00
serverAliases = ["notes-sandbox.purrfect.estate"];
2022-07-23 07:49:40 +01:00
locations."/" = {
proxyPass = "http://127.0.0.1:9005";
2022-07-23 07:49:40 +01:00
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";
};
2022-12-19 09:09:08 +00:00
ports = ["9005:80"];
2022-07-19 13:20:48 +01:00
};
}