Merge pull request #225946 from boozedog/boozedog/pgadmin-package

nixos/pgadmin: add package option
This commit is contained in:
Maciej Krüger 2023-12-26 12:38:50 +01:00 committed by GitHub
commit 51e1d86766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@
with lib;
let
pkg = pkgs.pgadmin4;
cfg = config.services.pgadmin;
_base = with types; [ int bool str ];
@ -36,6 +35,8 @@ in
default = 5050;
};
package = mkPackageOptionMD pkgs "pgadmin4" { };
initialEmail = mkOption {
description = lib.mdDoc "Initial email for the pgAdmin account";
type = types.str;
@ -150,7 +151,7 @@ in
echo "$PW"
# Retype password:
echo "$PW"
) | ${pkg}/bin/pgadmin4-setup
) | ${cfg.package}/bin/pgadmin4-setup
'';
restartTriggers = [
@ -162,7 +163,7 @@ in
DynamicUser = true;
LogsDirectory = "pgadmin";
StateDirectory = "pgadmin";
ExecStart = "${pkg}/bin/pgadmin4";
ExecStart = "${cfg.package}/bin/pgadmin4";
};
};