tsuki/vaultwarden: add vaultwarden, password manager
This commit is contained in:
parent
40e95ce030
commit
25b6f0f3e9
|
@ -24,6 +24,7 @@
|
||||||
./services/pgadmin.nix
|
./services/pgadmin.nix
|
||||||
./services/plex.nix
|
./services/plex.nix
|
||||||
./services/postgres.nix
|
./services/postgres.nix
|
||||||
|
./services/vaultwarden.nix
|
||||||
./services/vscode-server.nix
|
./services/vscode-server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,7 @@
|
||||||
(proxy ["py"] "http://localhost:${s ports.jupyterhub}" {
|
(proxy ["py"] "http://localhost:${s ports.jupyterhub}" {
|
||||||
locations."/".proxyWebsockets = true;
|
locations."/".proxyWebsockets = true;
|
||||||
})
|
})
|
||||||
|
(proxy ["bw"] "http://localhost:${s config.services.vaultwarden.config.ROCKET_PORT}" {})
|
||||||
(proxy ["docs"] "http://localhost:${s config.services.hedgedoc.settings.port}" {})
|
(proxy ["docs"] "http://localhost:${s config.services.hedgedoc.settings.port}" {})
|
||||||
(proxy ["map"] "http://localhost:${s ports.minecraft.dynmap}" {})
|
(proxy ["map"] "http://localhost:${s ports.minecraft.dynmap}" {})
|
||||||
(proxy ["yt"] "http://localhost:${s config.services.invidious.port}" {})
|
(proxy ["yt"] "http://localhost:${s config.services.invidious.port}" {})
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
{
|
||||||
|
services.vaultwarden = {
|
||||||
|
enable = true;
|
||||||
|
dbBackend = "postgresql";
|
||||||
|
# TODO: Set a database password
|
||||||
|
environmentFile = pkgs.writeText "vaultwarden.env" ''
|
||||||
|
DATABASE_URL=postgresql://vaultwarden:@%2Fvar%2Frun%2Fpostgresql/vaultwarden
|
||||||
|
'';
|
||||||
|
config = {
|
||||||
|
DOMAIN = "https://bw.nani.wtf";
|
||||||
|
SIGNUPS_ALLOWED = false;
|
||||||
|
ROCKET_ADDRESS = "127.0.0.1";
|
||||||
|
ROCKET_PORT = 8222;
|
||||||
|
ROCKET_LOG = "critical";
|
||||||
|
ROCKET_WORKERS = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.vaultwarden = {
|
||||||
|
requires = [ "postgresql.service" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
ensureDatabases = [ "vaultwarden" ];
|
||||||
|
ensureUsers = [
|
||||||
|
(rec {
|
||||||
|
name = "vaultwarden";
|
||||||
|
ensurePermissions = {
|
||||||
|
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue