New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metabase: init at 0.27.2 #33460
metabase: init at 0.27.2 #33460
Conversation
pkgs/servers/metabase/default.nix
Outdated
@@ -0,0 +1,28 @@ | |||
{ pkgs, stdenv, lib, fetchurl, makeWrapper, jre }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pkgs
parameter looks unused. Note also that lib
can be (and is typically) accessed via stdenv.lib
.
pkgs/servers/metabase/default.nix
Outdated
sha256 = "1xsd6k362kajbf6sw0pb7zkd686i350fqqin858a5mmjlm5jkci7"; | ||
}; | ||
|
||
buildInputs = [ makeWrapper ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeWrapper
can be treated as a nativeBuildInputs
pkgs/servers/metabase/default.nix
Outdated
|
||
buildInputs = [ makeWrapper ]; | ||
|
||
phases = "installPhase"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not explicitly list phases, instead disable those that are causing problems. While it may not matter to this package in particular, it is a common source of bugs.
pkgs/servers/metabase/default.nix
Outdated
''; | ||
|
||
meta = with lib; { | ||
description = "Metabase is the easy, open source way for everyone in your company to ask questions and learn from data."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please simplify Foo is a ...
to A ...
and drop trailing punctuation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the phases
and description
issues must be addressed before merging, otherwise LGTM at a surface level.
b774c0a
to
e9a7a37
Compare
I updated the package to 0.28.1, addressed your feedback and rebased on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A final nit.
pkgs/servers/metabase/default.nix
Outdated
@@ -0,0 +1,28 @@ | |||
{ pkgs, stdenv, fetchurl, makeWrapper, jre }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkgs
seems to be unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
pkgs/servers/metabase/default.nix
Outdated
installPhase = '' | ||
mkdir -p $out/share/java | ||
ln -s $jar $out/share/java/metabase.jar | ||
makeWrapper ${jre}/bin/java $out/bin/metabase --add-flags "-jar $out/share/java/metabase.jar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important, but I wonder if creating the dir/symlink is necessary; what if you just pass -jar $jar
?
In that case, the whole expression reduces to, basically
writeScriptBin "metabase" ''
#! /bin/sh
exec ${jre}/bin/java -jar ${jar} "$@"
''
Just something to consider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably not necessary, I am only not very Nix experienced yet.
How does writeScriptBin
work?
I tried
installPhase = writeScriptBin "metabase" ''
#!/bin/sh
exec ${jre}/bin/java -jar ${jar} "$@"
'';
But it fails with /nix/store/…/*-metabase: Is a directory
. I grepped for usage examples but could only find packages where writeScriptBin
is used in the let
scope for dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeScriptBin
is a function that given a name and text returns a derivation that produces an output comprising an executable script of that name containing that text under a bin/
directory.
In your case, installPhase
is supposed to be a Nix string (which is then exported to the builder); you're instead setting it to be a Nix derivation (evaluating to a store path).
What I was suggesting was that the whole package expression would reduce, essentially, to writeScriptBin
. That is, no installPhase
or anything. I'm not suggesting you do literally that :)
In the context of your original expression, something like (untested)
installPhase = ''
mkdir -p $out/bin
cat >$out/bin/metabase <<EOF
#! /bin/sh
exec ${jre}/bin/java -jar ${jar} "$@"
EOF
''
might work.
Anyway, this is not at all a blocker. Please just remove the redundant pkgs
parameter and I'd be happy to merge as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your explanation! ❤️ I decided to stick with the verbose approach because it is more common.
Not important, but I wonder if creating the dir/symlink is necessary; what if you just pass
-jar $jar
?
Fixed.
74f9a0b
to
9e5ead4
Compare
Motivation for this change
Added the https://metabase.com "uberjar". Tested on NixOS, the only issue I found was a compatibility problem with MariaDB which has already been reported upstream.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)