ncps: install dbmate-wrapper for ncps as dbmate-ncps (#478002)

This commit is contained in:
Wael Nasreddine
2026-01-08 08:45:29 +00:00
committed by GitHub
+23
View File
@@ -5,15 +5,32 @@
fetchFromGitHub,
jq,
lib,
makeWrapper,
mariadb,
minio,
minio-client,
postgresql,
python3,
redis,
writeShellScriptBin,
}:
let
dbmate-real = writeShellScriptBin "dbmate.real" ''
exec ${dbmate}/bin/dbmate "$@"
'';
dbmate-wrapper = buildGoModule {
pname = "ncps-dbmate-wrapper";
inherit (finalAttrs) version;
src = "${finalAttrs.src}/nix/dbmate-wrapper/src";
vendorHash = null;
subPackages = [ "." ];
};
finalAttrs = {
pname = "ncps";
version = "0.6.0";
@@ -46,6 +63,7 @@ let
postgresql # PostgreSQL for integration tests
python3 # used for generating the ports
redis # Redis for distributed locking integration tests
makeWrapper # For wrapping dbmate.
];
# pre and post checks
@@ -68,6 +86,11 @@ let
postInstall = ''
mkdir -p $out/share/ncps
cp -r db $out/share/ncps/db
makeWrapper ${dbmate-wrapper}/bin/dbmate-wrapper \
$out/bin/dbmate-ncps \
--prefix PATH : ${dbmate-real}/bin \
--set NCPS_DB_MIGRATIONS_DIR $out/share/ncps/db/migrations
'';
meta = {