Files
nixpkgs/pkgs/by-name/db/dbgate/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

97 lines
2.6 KiB
Nix

{
lib,
stdenv,
appimageTools,
fetchurl,
_7zz,
}:
let
pname = "dbgate";
version = "6.6.4";
src =
fetchurl
{
aarch64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_arm64.AppImage";
hash = "sha256-pwG+muAEVmyIK9eiCrydZ0glxPK5FGl7b3ps/8xeFgE=";
};
x86_64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_x86_64.AppImage";
hash = "sha256-4xsxYbVbbfxJ70CaB3z/reRoPgBom/XX6/YfT30uDpY=";
};
x86_64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_x64.dmg";
hash = "sha256-plG9n/JtPmyUcJoP4kcAttKpzpT7ytt2M82CT0zZ4tA=";
};
aarch64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_universal.dmg";
hash = "sha256-cId3K8m+XRlYHD4NyjSEyFR6c4Yvk6UzGAkdHt0bQUs=";
};
}
.${stdenv.hostPlatform.system} or (throw "dbgate: ${stdenv.hostPlatform.system} is unsupported.");
passthru.updateScript = ./update.sh;
meta = {
description = "Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others";
homepage = "https://dbgate.org/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
changelog = "https://github.com/dbgate/dbgate/releases/tag/v${version}";
mainProgram = "dbgate";
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
in
if stdenv.hostPlatform.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
passthru
meta
;
sourceRoot = ".";
nativeBuildInputs = [ _7zz ];
unpackPhase = "7zz x ${src}";
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications
runHook postInstall
'';
}
else
let
appimageContents = appimageTools.extract { inherit pname src version; };
in
appimageTools.wrapType2 {
inherit
pname
version
src
passthru
meta
;
extraInstallCommands = ''
install -Dm644 ${appimageContents}/dbgate.desktop -t $out/share/applications
substituteInPlace $out/share/applications/dbgate.desktop \
--replace-warn "Exec=AppRun --no-sandbox" "Exec=dbgate"
cp -r ${appimageContents}/usr/share/icons $out/share
'';
}