-
Notifications
You must be signed in to change notification settings - Fork 3
Nix shell derivation #1641
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
base: master
Are you sure you want to change the base?
Nix shell derivation #1641
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| let | ||
|
|
||
| nixpkgs = (import <nixpkgs> {}).pkgs.fetchFromGitHub { | ||
| owner = "NixOS"; repo = "nixpkgs"; | ||
| rev = "0011f9065a1ad1da4db67bec8d535d91b0a78fba"; # nixos-unstable | ||
| sha256 = "0m662mibyxqmp83zdhsi084p2h90268h3i8bfk3b2q8pbjz89yx2"; | ||
| }; | ||
|
|
||
| in with import nixpkgs {}; { | ||
| main = let | ||
| dnsimple = python27Packages.buildPythonPackage rec { | ||
| name = "dnsimple-${version}"; | ||
| version = "0.3.6"; | ||
|
|
||
| src = pkgs.fetchurl { | ||
| url = "mirror://pypi/d/dnsimple/${name}.tar.gz"; | ||
| sha256 = "0cc7v6wn246n3gjpzy8aq8v3xbrxl9a423b84i2z2cjjbq8b7fvf"; | ||
| }; | ||
|
|
||
| propagatedBuildInputs = [ python27Packages.requests ]; | ||
| }; | ||
| 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 ++ python27Packages.pycrypto.propagatedBuildInputs ++ dnsimple.propagatedBuildInputs); | ||
| profile = '' | ||
| source .env.local; | ||
| export PYTHONPATH="/usr/lib/python2.7/site-packages" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That’s a fake/virtual path, NixOS doesn’t have |
||
| ''; | ||
| }).env; | ||
|
|
||
| api-docs = stdenv.mkDerivation { | ||
| name = "api-docs"; | ||
| buildInputs = [ gcc pkgconfig nodejs-6_x ]; | ||
| shellHook = '' | ||
| source .env.local | ||
| cd api-docs | ||
| ''; | ||
| }; | ||
|
|
||
| ashes = let | ||
| flow25 = stdenv.lib.overrideDerivation flow (oldAttrs : rec { | ||
| name = "flow-${version}"; | ||
| version = "0.25.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "facebook"; | ||
| repo = "flow"; | ||
| rev = "v${version}"; | ||
| sha256 = "1v82phl1cb10p0ggjq9w6a0bcysjxwgmlqsp9263n3j52dl74yi8"; | ||
| }; | ||
| }); | ||
| in stdenv.mkDerivation { | ||
| name = "ashes"; | ||
| buildInputs = [ gcc pkgconfig fontconfig cairo libpng pixman nodejs-6_x flow25 ]; | ||
| shellHook = '' | ||
| source .env.local | ||
| cd ashes | ||
| ln -sf `readlink -f $(which flow)` node_modules/flow-bin/vendor/flow | ||
| ''; | ||
| }; | ||
|
|
||
| green-river = stdenv.mkDerivation { | ||
| name = "green-river"; | ||
| buildInputs = [ openjdk sbt ]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why openjdk, we use oracle one
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kpashka mesos/marathon are using oracle jdk as a runtime. |
||
| shellHook = '' | ||
| source .env.local | ||
| cd green-river | ||
| ''; | ||
| }; | ||
|
|
||
| middlewarehouse = stdenv.mkDerivation { | ||
| name = "middlewarehouse"; | ||
| buildInputs = [ go glide ]; | ||
| shellHook = '' | ||
| source .env.local | ||
| cd middlewarehouse | ||
| ''; | ||
| }; | ||
|
|
||
| phoenix = stdenv.mkDerivation { | ||
| name = "phoenix"; | ||
| buildInputs = [ openjdk sbt ]; | ||
| shellHook = '' | ||
| source .env.local | ||
| cd phoenix-scala | ||
| ''; | ||
| }; | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
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
pycryptoandlibcloud.