diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/admin/pgadmin/check-system-config-dir.patch | 17 | ||||
-rw-r--r-- | pkgs/tools/admin/pgadmin/default.nix | 22 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 40 insertions, 1 deletions
diff --git a/pkgs/tools/admin/pgadmin/check-system-config-dir.patch b/pkgs/tools/admin/pgadmin/check-system-config-dir.patch new file mode 100644 index 0000000000000..f614bab64e6fd --- /dev/null +++ b/pkgs/tools/admin/pgadmin/check-system-config-dir.patch @@ -0,0 +1,17 @@ +diff --git a/web/config.py b/web/config.py +index 4774043..5b73fd3 100644 +--- a/web/config.py ++++ b/web/config.py +@@ -884,6 +884,12 @@ if os.path.exists(system_config_dir + '/config_system.py'): + user_config_settings.update(config_system_settings) + except ImportError: + pass ++ except PermissionError: ++ print(f"Permission denied to open {str(system_config_dir + '/config_system.py')}. \n \ ++ If you are running pgadmin4-desktopmode please make sure you disable \n \ ++ the pgadmin NixOS module first. If you rely on settings in \n \ ++ {str(system_config_dir + '/config_system.py')}, please check the correct permissions.") ++ pass + + # Update settings for 'LOG_FILE', 'SQLITE_PATH', 'SESSION_DB_PATH', + # 'AZURE_CREDENTIAL_CACHE_DIR', 'KERBEROS_CCACHE_DIR', 'STORAGE_DIR' \ No newline at end of file diff --git a/pkgs/tools/admin/pgadmin/default.nix b/pkgs/tools/admin/pgadmin/default.nix index 2f85b4e3aff99..a83d96779de6a 100644 --- a/pkgs/tools/admin/pgadmin/default.nix +++ b/pkgs/tools/admin/pgadmin/default.nix @@ -9,6 +9,7 @@ , fetchPypi , postgresqlTestHook , postgresql +, server-mode ? true }: let @@ -88,6 +89,8 @@ pythonPackages.buildPythonApplication rec { patches = [ # Expose setup.py for later use ./expose-setup.py.patch + # check for permission of /etc/pgadmin/config_system and don't fail + ./check-system-config-dir.patch ]; postPatch = '' @@ -105,6 +108,10 @@ pythonPackages.buildPythonApplication rec { sed 's|==|>=|g' -i requirements.txt substituteInPlace pkg/pip/setup_pip.py \ --replace "req = req.replace('psycopg2', 'psycopg2-binary')" "req = req" + ${lib.optionalString (!server-mode) '' + substituteInPlace web/config.py \ + --replace "SERVER_MODE = True" "SERVER_MODE = False" + ''} ''; preBuild = '' @@ -242,7 +249,20 @@ pythonPackages.buildPythonApplication rec { ''; meta = with lib; { - description = "Administration and development platform for PostgreSQL"; + description = "Administration and development platform for PostgreSQL${optionalString (!server-mode) ". Desktop Mode"}"; + longDescription = '' + pgAdmin 4 is designed to meet the needs of both novice and experienced Postgres users alike, + providing a powerful graphical interface that simplifies the creation, maintenance and use of database objects. + ${if server-mode then '' + This version is build with SERVER_MODE set to True (the default). It will require access to `/var/lib/pgadmin` + and `/var/log/pgadmin`. This is the default version for the NixOS module `services.pgadmin`. + This should NOT be used in combination with the `pgadmin4-desktopmode` package as they will interfere. + '' else '' + This version is build with SERVER_MODE set to False. It will require access to `~/.pgadmin/`. This version is suitable + for single-user deployment or where access to `/var/lib/pgadmin` cannot be granted or the NixOS module cannot be used. + This should NOT be used in combination with the NixOS module `pgadmin` as they will interfere. + ''} + ''; homepage = "https://www.pgadmin.org/"; license = licenses.mit; changelog = "https://www.pgadmin.org/docs/pgadmin4/latest/release_notes_${lib.versions.major version}_${lib.versions.minor version}.html"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8afd5a0055a02..73131f79dad3a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37950,6 +37950,8 @@ with pkgs; pgadmin4 = callPackage ../tools/admin/pgadmin { }; + pgadmin4-desktopmode = callPackage ../tools/admin/pgadmin { server-mode = false; }; + pgmodeler = qt6Packages.callPackage ../applications/misc/pgmodeler { }; physlock = callPackage ../misc/screensavers/physlock { }; |