2024-11-23 15:45:19 -05:00
|
|
|
{ lib, ... }:
|
2024-11-10 17:54:08 -05:00
|
|
|
let
|
2024-11-26 21:43:36 -05:00
|
|
|
domain = "steelmountain.brownbread.net";
|
2024-11-10 17:54:08 -05:00
|
|
|
port = "11001";
|
2024-11-23 15:45:19 -05:00
|
|
|
directory = "/opt/vaultwarden";
|
2024-11-10 17:54:08 -05:00
|
|
|
in
|
|
|
|
{
|
2024-11-23 15:45:19 -05:00
|
|
|
systemd.tmpfiles.rules =
|
|
|
|
map (x: "d ${x} 0755 share share - -") (lib.lists.singleton directory);
|
|
|
|
|
2024-11-10 17:54:08 -05:00
|
|
|
virtualisation.oci-containers.containers.vaultwarden = {
|
|
|
|
image = "vaultwarden/server:latest";
|
|
|
|
autoStart = true;
|
|
|
|
ports = [
|
|
|
|
"${port}:80"
|
|
|
|
];
|
|
|
|
volumes = [
|
2024-11-23 15:45:19 -05:00
|
|
|
"${directory}/data:/data"
|
2024-11-10 17:54:08 -05:00
|
|
|
];
|
|
|
|
environment = {
|
|
|
|
DOMAIN = domain;
|
|
|
|
WEBSOCKET_ENABLED = "true";
|
|
|
|
SIGNUPS_ALLOWED = "false";
|
|
|
|
SHOW_PASSWORD_HINT = "false";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-23 15:45:19 -05:00
|
|
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
2024-11-10 17:54:08 -05:00
|
|
|
encode zstd gzip
|
|
|
|
reverse_proxy http://localhost:${port} {
|
|
|
|
header_up X-Real-IP {remote_host}
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|