-
Notifications
You must be signed in to change notification settings - Fork 3
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
Nix shell derivation #1641
base: master
Are you sure you want to change the base?
Nix shell derivation #1641
Conversation
|
||
green-river = stdenv.mkDerivation { | ||
name = "green-river"; | ||
buildInputs = [ openjdk sbt ]; |
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.
Why openjdk, we use oracle one
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.
On production machines? From the very beginning we’ve been using OpenJDK on our developer machines, so it probably doesn’t matter as much, and it allows devs’ machines to stay in the non-proprietary land, for ones that care. :)
But it would be pretty easy to change. To use Oracle’s JVM, you’d have to change with import nixpkgs {}
in L9 to with import nixpkgs { allowUnfree = true; }
or similar.
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.
Yeah, I meant on production and CI. I prefer to have same version on local just because the difference can introduce weird behaviors. Anyway, it's up to you, I just wanted to point at the difference in config
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.
Mhm! OpenJDK and Oracle are almost the same, but @kjanosz would know more about that.
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.
@Axblade we don't use any JDK at all, even seeders run via docker containers
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.
@kpashka mesos/marathon are using oracle jdk as a runtime.
Also it's interesting that we use openjdk containers... So I was not actually right declaring that we use oracle one for phoenix/greenriver.
But it is inconsistent...
default.nix
Outdated
targetPkgs = pkgs: (with pkgs; [ ansible2 curl dnsimple docker gnumake git google-cloud-sdk openssh python27Full python27Packages.libcloud python27Packages.pycrypto python27Packages.requests rsync ] ++ python27Packages.libcloud.propagatedBuildInputs ++ dnsimple.propagatedBuildInputs); | ||
profile = '' | ||
source .env.local; | ||
export PYTHONPATH="/usr/lib/python2.7/site-packages" |
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.
That’s a fake/virtual path, NixOS doesn’t have /usr
, but buildFHSUserEnv
fakes that in nix-shell -A main
for broken programs (in this case: Ansible).
75cdac1
to
8eda142
Compare
default.nix
Outdated
@@ -21,7 +21,7 @@ in with import nixpkgs {}; { | |||
}; | |||
in (buildFHSUserEnv { | |||
name = "main"; | |||
targetPkgs = pkgs: (with pkgs; [ ansible2 curl dnsimple docker gnumake git google-cloud-sdk openssh python27Full python27Packages.libcloud python27Packages.pycrypto python27Packages.requests rsync ] ++ python27Packages.libcloud.propagatedBuildInputs ++ dnsimple.propagatedBuildInputs); | |||
targetPkgs = pkgs: (with pkgs; [ ansible2 curl dnsimple docker gnumake git google-cloud-sdk openssh python27Full python27Packages.libcloud python27Packages.pycrypto python27Packages.requests rsync ] ++ python27Packages.libcloud.propagatedBuildInputs ++ python27Packages.pycrypto.propagatedBuildInputs ++ dnsimple.propagatedBuildInputs); |
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.
@kjanosz, IMO, there’s something wrong with this FHS creation, if you need to supply the deps twice.
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.
WDYM? Where are they supplied first time?
EDIT:
ah, you've meant propagatedBuildInputs
?
Yeah, was surprised, but couldn't get it working without it.
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.
Yes!
Both for pycrypto
and libcloud
.
make prepare
asks me for my root password, which is pretty insane.Here’s a PR with @kjanosz’s
default.nix
that set ups the environment, there was a branch but no PR.I pinned it to Nixpkgs 16.09 for greater reproducibility.
Example usage: