summaryrefslogtreecommitdiffstats
path: root/2configs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-04-04 08:43:55 +0200
committermakefu <github@syntax-fehler.de>2021-04-04 08:43:55 +0200
commitf8b361da104e7140f18fb3a452a7d4997e2e9482 (patch)
treeb7849bcc110e2d12300ac24ec03226fe63496190 /2configs
parentdc8d28e2b93ea94ab03b7d45c6d1c4de2cbd4f5c (diff)
ma bitwarden: init for gum.r
Diffstat (limited to '2configs')
-rw-r--r--2configs/bitwarden.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/2configs/bitwarden.nix b/2configs/bitwarden.nix
new file mode 100644
index 000000000..7e317e596
--- /dev/null
+++ b/2configs/bitwarden.nix
@@ -0,0 +1,46 @@
+{ pkgs, ... }:
+let
+ port = 8812;
+in {
+ services.bitwarden_rs = {
+ enable = true;
+ dbBackend = "postgresql";
+ config.signups_allowed = false;
+ config.rocketPort = port;
+ config.domain = "https://bw.euer.krebsco.de";
+ #config.databaseUrl = "postgresql://bitwardenuser:${dbPassword}@localhost/bitwarden";
+ config.databaseUrl = "postgresql:///bitwarden";
+ config.websocket_enabled = true;
+ };
+
+ systemd.services.bitwarden_rs.after = [ "postgresql.service" ];
+
+ services.postgresql = {
+ enable = true;
+ ensureDatabases = [ "bitwarden" ];
+ ensureUsers = [ { name = "bitwarden_rs"; ensurePermissions."DATABASE bitwarden" = "ALL PRIVILEGES"; } ];
+ #initialScript = pkgs.writeText "postgresql-init.sql" ''
+ # CREATE DATABASE bitwarden;
+ # CREATE USER bitwardenuser WITH PASSWORD '${dbPassword}';
+ # GRANT ALL PRIVILEGES ON DATABASE bitwarden TO bitwardenuser;
+ #'';
+ };
+
+ services.nginx.virtualHosts."bw.euer.krebsco.de" ={
+ forceSSL = true;
+ enableACME = true;
+
+ locations."/" = {
+ proxyPass = "http://localhost:8812";
+ proxyWebsockets = true;
+ };
+ locations."/notifications/hub" = {
+ proxyPass = "http://localhost:3012";
+ proxyWebsockets = true;
+ };
+ locations."/notifications/hub/negotiate" = {
+ proxyPass = "http://localhost:8812";
+ proxyWebsockets = true;
+ };
+ };
+}
[cgit] Unable to lock slot /tmp/cgit/ba000000.lock: No such file or directory (2)