nixpkgs/pkgs/by-name/db/dbgate/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.8 KiB
Nix
Raw Normal View History

2024-05-13 17:12:14 +01:00
{
lib,
stdenv,
fetchurl,
undmg,
appimageTools,
}:
let
pname = "dbgate";
2024-08-08 09:55:12 +01:00
version = "5.3.4";
2024-05-13 17:12:14 +01:00
src =
fetchurl
{
aarch64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_arm64.AppImage";
2024-08-08 09:55:12 +01:00
hash = "sha256-szG0orYBB1+DE9Vwjq0sluIaLDBlWOScKuruJR4iQKg=";
2024-05-13 17:12:14 +01:00
};
x86_64-linux = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-linux_x86_64.AppImage";
2024-08-08 09:55:12 +01:00
hash = "sha256-C0BJ3dydaeV8ypc8c0EDiMBhvByLAKuKTGHOozqbd+w=";
2024-05-13 17:12:14 +01:00
};
x86_64-darwin = {
url = "https://github.com/dbgate/dbgate/releases/download/v${version}/dbgate-${version}-mac_x64.dmg";
2024-08-08 09:55:12 +01:00
hash = "sha256-WwUpFFeZ9NmosHZqrHCbsz673fSbdQvwxhEvz/6JJtw=";
2024-05-13 17:12:14 +01:00
};
}
.${stdenv.system} or (throw "dbgate: ${stdenv.system} is unsupported.");
2024-06-09 15:59:56 +01:00
meta = {
2024-05-13 17:12:14 +01:00
description = "Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others";
2024-06-09 15:59:56 +01:00
homepage = "https://dbgate.org/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
changelog = "https://github.com/dbgate/dbgate/releases/tag/v${version}";
2024-05-13 17:12:14 +01:00
mainProgram = "dbgate";
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
];
2024-06-09 15:59:56 +01:00
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
2024-05-13 17:12:14 +01:00
};
in
if stdenv.isDarwin then
stdenv.mkDerivation {
inherit
pname
version
src
meta
;
sourceRoot = ".";
nativeBuildInputs = [ undmg ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications
runHook postInstall
'';
}
else
appimageTools.wrapType2 {
inherit
pname
version
src
meta
;
}