mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
workspaceDir =
|
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
|
"home-files/Library/DBeaverData/workspace6"
|
|
else
|
|
"home-files/.local/share/DBeaverData/workspace6";
|
|
in
|
|
{
|
|
programs.dbeaver = {
|
|
enable = true;
|
|
dataSourcesSettings = {
|
|
folders = { };
|
|
connections = {
|
|
"postgresql-local" = {
|
|
provider = "postgresql";
|
|
driver = "postgres-jdbc";
|
|
name = "Local PostgreSQL";
|
|
save-password = false;
|
|
configuration = {
|
|
host = "localhost";
|
|
port = "5432";
|
|
database = "mydb";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
dataSourcesFile=${workspaceDir}/General/.dbeaver/data-sources.json
|
|
assertFileExists $dataSourcesFile
|
|
assertFileContent $dataSourcesFile ${builtins.toFile "expected" ''
|
|
{
|
|
"connections": {
|
|
"postgresql-local": {
|
|
"configuration": {
|
|
"database": "mydb",
|
|
"host": "localhost",
|
|
"port": "5432"
|
|
},
|
|
"driver": "postgres-jdbc",
|
|
"name": "Local PostgreSQL",
|
|
"provider": "postgresql",
|
|
"save-password": false
|
|
}
|
|
},
|
|
"folders": {}
|
|
}
|
|
''}
|
|
'';
|
|
}
|