update check

This commit is contained in:
2025-03-16 00:14:07 +04:00
parent 9efbbbacdf
commit 6858834b20

20
lib.nix
View File

@@ -50,10 +50,12 @@ in
in in
pkgs.writeShellApplication { pkgs.writeShellApplication {
inherit name; inherit name;
text = checks ++ '' text =
PC_CONFIG_FILES=${configFile} ${pkgs.process-compose}/bin/process-compose "$@" checks
+ ''
PC_CONFIG_FILES=${configFile} ${pkgs.process-compose}/bin/process-compose "$@"
''; '';
}; };
mkPostgres = mkPostgres =
{ {
@@ -87,17 +89,17 @@ in
else if false == value then else if false == value then
"no" "no"
else if lib.isString value then else if lib.isString value then
"'${lib.replaceStrings [ "'" ] [ "''" value ]}'" "'${lib.replaceStrings [ "'" ] [ "''" ] value}'"
else else
builtins.toString value; builtins.toString value;
configFile = pkgs.writeTextDir "postgresql.conf" ( configFile = pkgs.writeTextDir "postgresql.conf" (
lib.concatStringSep "\n" ( lib.concatStringsSep "\n" (
lib.mapAttrsToList (n: v: "${n} = ${toStr v}") (lib.filterAttrs ( lib.mapAttrsToList (n: v: "${n} = ${toStr v}") (
lib.const (x: x != null) lib.filterAttrs (lib.const (x: x != null)) merged_config
)) merged_config )
) )
); );
configFileCheck = pkgs.writeShellScript { configFileCheck = pkgs.writeShellApplication {
name = "check"; name = "check";
text = '' text = ''
${package}/bin/postgres -D${configFile} -C config_file ${package}/bin/postgres -D${configFile} -C config_file