2021-01-20 00:43:03 -08:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
{
|
2021-08-09 08:18:25 -07:00
|
|
|
modules.services.vaultwarden.enable = true;
|
2021-01-20 00:43:03 -08:00
|
|
|
|
2021-08-09 08:18:25 -07:00
|
|
|
services.vaultwarden.config = {
|
2021-01-20 00:43:03 -08:00
|
|
|
signupsAllowed = false;
|
|
|
|
invitationsAllowed = true;
|
|
|
|
domain = "https://p.v0.io";
|
|
|
|
httpPort = 8002;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Inject secrets at runtime
|
2021-08-09 08:18:25 -07:00
|
|
|
systemd.services.vaultwarden.serviceConfig = {
|
|
|
|
EnvironmentFile = [ config.age.secrets.vaultwarden-smtp-env.path ];
|
2021-01-20 00:43:03 -08:00
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "2s";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."p.v0.io" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2021-01-30 14:07:52 -08:00
|
|
|
root = "/srv/www/p.v0.io";
|
2021-01-20 00:43:03 -08:00
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 128M;
|
|
|
|
'';
|
|
|
|
locations = {
|
|
|
|
"/".proxyPass = "http://127.0.0.1:8000";
|
|
|
|
"/notifications/hub".proxyWebsockets = true;
|
|
|
|
"/notifications/hub/negotiate".proxyPass = "http://127.0.0.1:8001";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|