Add dbeaver pkgs for latest updates
This commit is contained in:
parent
1165326ad1
commit
d40b7d85f5
5 changed files with 158 additions and 39 deletions
41
flake.nix
41
flake.nix
|
@ -165,6 +165,7 @@
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit config system overlays;
|
inherit config system overlays;
|
||||||
};
|
};
|
||||||
|
lib = pkgs.lib;
|
||||||
hmModules = [
|
hmModules = [
|
||||||
nix-index-database.hmModules.nix-index
|
nix-index-database.hmModules.nix-index
|
||||||
nur.hmModules.nur
|
nur.hmModules.nur
|
||||||
|
@ -190,45 +191,7 @@
|
||||||
formatter = {
|
formatter = {
|
||||||
${system} = pkgs.nixpkgs-fmt;
|
${system} = pkgs.nixpkgs-fmt;
|
||||||
};
|
};
|
||||||
packages."${system}" =
|
packages."${system}" = import ./pkgs { inherit pkgs lib; };
|
||||||
let
|
|
||||||
# list paths
|
|
||||||
pkgs-paths-list = pkgs.lib.fileset.toList (pkgs.lib.fileset.fromSource (pkgs.lib.sources.sourceFilesBySuffices ./pkgs [ ".nix" ]));
|
|
||||||
# filename-extension parsed out
|
|
||||||
pkgs-paths =
|
|
||||||
builtins.map
|
|
||||||
(path: {
|
|
||||||
name = pkgs.lib.strings.removeSuffix ".nix" (builtins.baseNameOf path);
|
|
||||||
path = path;
|
|
||||||
})
|
|
||||||
pkgs-paths-list;
|
|
||||||
# import each path
|
|
||||||
imported-pkgs = pkgs.lib.attrsets.mergeAttrsList (builtins.map
|
|
||||||
(pkg: {
|
|
||||||
"${pkg.name}" = pkgs.callPackage pkg.path { };
|
|
||||||
})
|
|
||||||
pkgs-paths);
|
|
||||||
# kexec-installer-path = ./systems/rescue-kexec;
|
|
||||||
kexec-installer-path = builtins.toPath "${inputs.nixos-images}/nix/kexec-installer/module.nix";
|
|
||||||
kexec-installer-fn = nixpkgs: module: (nixpkgs.legacyPackages.${system}.nixos [ module kexec-installer-path ]).config.system.build.kexecTarball;
|
|
||||||
# rescue-kexec-fn = ./systems/rescue-kexec;
|
|
||||||
kexec-pkgs = {
|
|
||||||
# build:
|
|
||||||
# nix build ".#packages.x86_64-linux.rescue-kexec-pkg"
|
|
||||||
#
|
|
||||||
# copy over single files:
|
|
||||||
# tar -xvf result/nixos-kexec-installer-x86_64-linux.tar.gz
|
|
||||||
# ssh root@176.9.242.147 "mkdir /root/kexec/"
|
|
||||||
# for file in (ls ./kexec/); echo Transferring $file; cat ./kexec/$file | ssh root@176.9.242.147 "cat > /root/kexec/$file" ; end
|
|
||||||
# ssh root@176.9.242.147 "/root/kexec/run"
|
|
||||||
rescue-kexec-pkg = kexec-installer-fn nixpkgs {
|
|
||||||
imports = [ ./systems/rescue-kexec ];
|
|
||||||
# imports = [ ];
|
|
||||||
_module.args = { inherit inputs; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
imported-pkgs // kexec-pkgs;
|
|
||||||
diskoConfigurations = {
|
diskoConfigurations = {
|
||||||
nixos-desk = import ./systems/nixos-desk/disko.nix;
|
nixos-desk = import ./systems/nixos-desk/disko.nix;
|
||||||
nixos-pulse = import ./systems/nixos-pulse/disko.nix;
|
nixos-pulse = import ./systems/nixos-pulse/disko.nix;
|
||||||
|
|
|
@ -118,6 +118,8 @@
|
||||||
pcsx2
|
pcsx2
|
||||||
xdelta
|
xdelta
|
||||||
winetricks
|
winetricks
|
||||||
|
my.dbeaver
|
||||||
|
# dbeaver-bin
|
||||||
# blender
|
# blender
|
||||||
# miraclecast
|
# miraclecast
|
||||||
# rustdesk
|
# rustdesk
|
||||||
|
|
129
pkgs/dbeaver.nix
Normal file
129
pkgs/dbeaver.nix
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
{ lib
|
||||||
|
, stdenvNoCC
|
||||||
|
, fetchurl
|
||||||
|
, undmg
|
||||||
|
, makeWrapper
|
||||||
|
, openjdk17
|
||||||
|
, gnused
|
||||||
|
, autoPatchelfHook
|
||||||
|
, wrapGAppsHook3
|
||||||
|
, gtk3
|
||||||
|
, glib
|
||||||
|
, webkitgtk_4_0
|
||||||
|
, glib-networking
|
||||||
|
, override_xmx ? "1024m"
|
||||||
|
,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
|
pname = "dbeaver-bin";
|
||||||
|
version = "24.2.5";
|
||||||
|
|
||||||
|
src =
|
||||||
|
let
|
||||||
|
inherit (stdenvNoCC.hostPlatform) system;
|
||||||
|
selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}");
|
||||||
|
suffix = selectSystem {
|
||||||
|
x86_64-linux = "linux.gtk.x86_64-nojdk.tar.gz";
|
||||||
|
aarch64-linux = "linux.gtk.aarch64-nojdk.tar.gz";
|
||||||
|
x86_64-darwin = "macos-x86_64.dmg";
|
||||||
|
aarch64-darwin = "macos-aarch64.dmg";
|
||||||
|
};
|
||||||
|
hash = selectSystem {
|
||||||
|
x86_64-linux = "sha256-LnJq23o60c+Ys0V46esP1bIkcnzj26hQUBu3Ut9bMJM=";
|
||||||
|
aarch64-linux = "";
|
||||||
|
x86_64-darwin = "";
|
||||||
|
aarch64-darwin = "";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
fetchurl {
|
||||||
|
url = "https://github.com/dbeaver/dbeaver/releases/download/${finalAttrs.version}/dbeaver-ce-${finalAttrs.version}-${suffix}";
|
||||||
|
inherit hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
sourceRoot = lib.optional stdenvNoCC.hostPlatform.isDarwin "DBeaver.app";
|
||||||
|
|
||||||
|
nativeBuildInputs =
|
||||||
|
[ makeWrapper ]
|
||||||
|
++ lib.optionals (!stdenvNoCC.hostPlatform.isDarwin) [
|
||||||
|
gnused
|
||||||
|
wrapGAppsHook3
|
||||||
|
autoPatchelfHook
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ undmg ];
|
||||||
|
|
||||||
|
dontConfigure = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
prePatch = ''
|
||||||
|
substituteInPlace ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "Contents/Eclipse/"}dbeaver.ini \
|
||||||
|
--replace-fail '-Xmx1024m' '-Xmx${override_xmx}'
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase =
|
||||||
|
if !stdenvNoCC.hostPlatform.isDarwin
|
||||||
|
then ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/opt/dbeaver $out/bin
|
||||||
|
cp -r * $out/opt/dbeaver
|
||||||
|
makeWrapper $out/opt/dbeaver/dbeaver $out/bin/dbeaver \
|
||||||
|
--prefix PATH : "${openjdk17}/bin" \
|
||||||
|
--set JAVA_HOME "${openjdk17.home}" \
|
||||||
|
--prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \
|
||||||
|
--prefix LD_LIBRARY_PATH : "$out/lib:${
|
||||||
|
lib.makeLibraryPath [
|
||||||
|
gtk3
|
||||||
|
glib
|
||||||
|
webkitgtk_4_0
|
||||||
|
glib-networking
|
||||||
|
]
|
||||||
|
}"
|
||||||
|
|
||||||
|
mkdir -p $out/share/icons/hicolor/256x256/apps
|
||||||
|
ln -s $out/opt/dbeaver/dbeaver.png $out/share/icons/hicolor/256x256/apps/dbeaver.png
|
||||||
|
|
||||||
|
mkdir -p $out/share/applications
|
||||||
|
ln -s $out/opt/dbeaver/dbeaver-ce.desktop $out/share/applications/dbeaver.desktop
|
||||||
|
|
||||||
|
substituteInPlace $out/opt/dbeaver/dbeaver-ce.desktop \
|
||||||
|
--replace-fail "/usr/share/dbeaver-ce/dbeaver.png" "dbeaver" \
|
||||||
|
--replace-fail "/usr/share/dbeaver-ce/dbeaver" "$out/bin/dbeaver"
|
||||||
|
|
||||||
|
sed -i '/^Path=/d' $out/share/applications/dbeaver.desktop
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
''
|
||||||
|
else ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/{Applications/dbeaver.app,bin}
|
||||||
|
cp -R . $out/Applications/dbeaver.app
|
||||||
|
makeWrapper $out/{Applications/dbeaver.app/Contents/MacOS,bin}/dbeaver \
|
||||||
|
--prefix PATH : "${openjdk17}/bin" \
|
||||||
|
--set JAVA_HOME "${openjdk17.home}"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://dbeaver.io/";
|
||||||
|
description = "Universal SQL Client for developers, DBA and analysts. Supports MySQL, PostgreSQL, MariaDB, SQLite, and more";
|
||||||
|
longDescription = ''
|
||||||
|
Free multi-platform database tool for developers, SQL programmers, database
|
||||||
|
administrators and analysts. Supports all popular databases: MySQL,
|
||||||
|
PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access,
|
||||||
|
Teradata, Firebird, Derby, etc.
|
||||||
|
'';
|
||||||
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||||
|
license = licenses.asl20;
|
||||||
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
|
maintainers = with maintainers; [
|
||||||
|
gepbird
|
||||||
|
mkg20001
|
||||||
|
yzx9
|
||||||
|
];
|
||||||
|
mainProgram = "dbeaver";
|
||||||
|
};
|
||||||
|
})
|
25
pkgs/default.nix
Normal file
25
pkgs/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# list paths
|
||||||
|
pkgs-paths-list = pkgs.lib.fileset.toList (pkgs.lib.fileset.fromSource (pkgs.lib.sources.sourceFilesBySuffices ./. [ ".nix" ]));
|
||||||
|
# no default.nix
|
||||||
|
filtered-paths-list = builtins.filter (path: builtins.baseNameOf path != "default.nix") pkgs-paths-list;
|
||||||
|
# filename-extension parsed out
|
||||||
|
pkgs-paths =
|
||||||
|
builtins.map
|
||||||
|
(path: {
|
||||||
|
name = pkgs.lib.strings.removeSuffix ".nix" (builtins.baseNameOf path);
|
||||||
|
path = path;
|
||||||
|
})
|
||||||
|
filtered-paths-list;
|
||||||
|
# import each path
|
||||||
|
imported-pkgs = pkgs.lib.attrsets.mergeAttrsList (builtins.map
|
||||||
|
(pkg: {
|
||||||
|
"${pkg.name}" = pkgs.callPackage pkg.path { };
|
||||||
|
})
|
||||||
|
pkgs-paths);
|
||||||
|
in
|
||||||
|
imported-pkgs
|
0
pkgs/kexec-pkgs
Normal file
0
pkgs/kexec-pkgs
Normal file
Loading…
Add table
Reference in a new issue