add modules

Former-commit-id: d199f35824
This commit is contained in:
Hadi
2025-03-19 13:55:03 +01:00
parent fa76704fb5
commit 29ff0aa3dd
5 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
{ config, ... }:
let domain = "vault.hadi.diy";
in {
services.vaultwarden = {
enable = true;
config = {
DOMAIN = "https://" + domain;
SIGNUPS_ALLOWED = true;
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
ROCKET_LOG = "critical";
};
};
services.nginx.virtualHosts."${domain}" = {
useACMEHost = "hadi.diy";
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${
toString config.services.vaultwarden.config.ROCKET_PORT
}";
};
};
security.acme.certs."hadi.diy" = {
domain = "hadi.diy";
extraDomainNames = [ "*.hadi.diy" ];
group = "nginx";
dnsProvider = "cloudflare";
dnsPropagationCheck = true;
credentialsFile = config.sops.secrets.cloudflare-dns-token.path;
};
}