mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 05:13:10 +01:00
fixed vaultwarden
This commit is contained in:
parent
6b41537bc2
commit
e8d6ca3917
|
@ -7,6 +7,7 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules/networks
|
./modules/networks
|
||||||
./modules/nextcloud
|
./modules/nextcloud
|
||||||
|
./modules/vaultwarden
|
||||||
./modules/nginx
|
./modules/nginx
|
||||||
../../shared/vim.nix
|
../../shared/vim.nix
|
||||||
../../shared/sops.nix
|
../../shared/sops.nix
|
||||||
|
|
|
@ -3,22 +3,36 @@ let
|
||||||
domain = "vault.rfive.de";
|
domain = "vault.rfive.de";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config.sops.secrets."vaultwarden/env" = { };
|
sops.secrets."vaultwarden/env".owner = "vaultwarden";
|
||||||
services.vaultwarden = {
|
services.vaultwarden = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dbBackend = "postgresql";
|
dbBackend = "postgresql";
|
||||||
environmentFile = config.sops.secrets."vaultwarden/env".path;
|
environmentFile = config.sops.secrets."vaultwarden/env".path;
|
||||||
config = {
|
config = {
|
||||||
domain = domain;
|
domain = "https://${domain}";
|
||||||
signupsAllowed = false;
|
signupsAllowed = false;
|
||||||
|
# somehow this works
|
||||||
|
databaseUrl = "postgresql://vaultwarden@%2Frun%2Fpostgresql/vaultwarden";
|
||||||
rocketPort = 8000;
|
rocketPort = 8000;
|
||||||
};
|
};
|
||||||
services.nginx.virtualHosts."bitwarden.example.com" = {
|
};
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "vaultwarden";
|
||||||
|
ensurePermissions = {
|
||||||
|
"DATABASE vaultwarden" = "ALL PRIVILEGES";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
ensureDatabases = [ "vaultwarden" ];
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
|
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.rocketPort}";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue