Update default.nix

This commit is contained in:
AG 2025-10-30 15:27:03 +01:00
parent eac26713c7
commit f1faa10d33
1 changed files with 55 additions and 45 deletions

View File

@ -1,4 +1,6 @@
{ pkgs ? import <nixpkgs> { } }: {
pkgs ? import <nixpkgs> { },
}:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "apache-hop"; pname = "apache-hop";
@ -41,20 +43,20 @@ pkgs.stdenv.mkDerivation rec {
create_wrapper_script() { create_wrapper_script() {
local script_name=$1 local script_name=$1
cat > $out/bin/$script_name << EOF cat > $out/bin/$script_name << EOF
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
export HOP_CONFIG_FOLDER="\$HOME/.hop/config" export HOP_CONFIG_FOLDER="\$HOME/.hop/config"
export HOP_AUDIT_FOLDER="\$HOME/.hop/audit" export HOP_AUDIT_FOLDER="\$HOME/.hop/audit"
mkdir -p "\$HOP_CONFIG_FOLDER" "\$HOP_AUDIT_FOLDER" mkdir -p "\$HOP_CONFIG_FOLDER" "\$HOP_AUDIT_FOLDER"
if [ ! -f "\$HOP_CONFIG_FOLDER/hop-config.json" ]; then if [ ! -f "\$HOP_CONFIG_FOLDER/hop-config.json" ]; then
cp -r $out/opt/apache-hop/config/* "\$HOP_CONFIG_FOLDER/" cp -r $out/opt/apache-hop/config/* "\$HOP_CONFIG_FOLDER/"
fi fi
exec $out/opt/apache-hop/$script_name.sh "\$@" exec $out/opt/apache-hop/$script_name.sh "\$@"
EOF EOF
chmod +x $out/bin/$script_name chmod +x $out/bin/$script_name
} }
@ -66,16 +68,18 @@ EOF
mv $out/bin/$script $out/bin/.$script-wrapped mv $out/bin/$script $out/bin/.$script-wrapped
makeWrapper $out/bin/.$script-wrapped $out/bin/$script \ makeWrapper $out/bin/.$script-wrapped $out/bin/$script \
--set JAVA_HOME "${pkgs.jdk17}" \ --set JAVA_HOME "${pkgs.jdk17}" \
--prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath [ --prefix LD_LIBRARY_PATH : "${
pkgs.lib.makeLibraryPath [
pkgs.gtk3 pkgs.gtk3
pkgs.glib pkgs.glib
pkgs.webkitgtk_4_1 pkgs.webkitgtk_4_1
pkgs.libsoup_2_4 pkgs.libsoup_3
pkgs.cairo pkgs.cairo
pkgs.gdk-pixbuf pkgs.gdk-pixbuf
pkgs.atk pkgs.atk
pkgs.pango pkgs.pango
]}" ]
}"
done done
chmod +x $out/opt/apache-hop/*.sh chmod +x $out/opt/apache-hop/*.sh
@ -95,8 +99,14 @@ EOF
comment = "Data Integration Platform"; comment = "Data Integration Platform";
exec = "hop-gui"; exec = "hop-gui";
icon = "hop"; icon = "hop";
categories = [ "Development" "Database" ]; categories = [
mimeTypes = [ "application/x-hop-workflow" "application/x-hop-pipeline" ]; "Development"
"Database"
];
mimeTypes = [
"application/x-hop-workflow"
"application/x-hop-pipeline"
];
}) })
]; ];