[Nix-dev] Project environment setup

Daniel Hlynskyi abcz2.uprola at gmail.com
Tue Jul 19 08:49:10 CEST 2016


Looks like gradle25 package doesn't follow nixpkgs conventions here. It has
no `.override` attribute, which, as I remember, is added by `callPackage`
function.
I think this is a bug, but there is a workaround:

```
# shell.nix

{ pkgs ? import <nixpkgs> {} }:
let
  mygradle = (pkgs.gradleGen.override {
    jdk = pkgs.openjdk8;
  }).gradle25;
in pkgs.stdenv.mkDerivation {
    name = "myproject";
    buildInputs = [ mygradle ];
}
```

You didn't want `.overrideDerivation` here, I think, just `.override`.

2016-07-19 3:53 GMT+03:00 Ryan Eckbo <eckbo at cim.mcgill.ca>:

> I've been reading the docs and blog posts but I'm still unsure on the
> proper
> way to configure a local shell.nix with my required modified packages.
> Specifically, I need gradle built with jdk 8, something like
>
>    pkgs.gradle25.override { jdk = pkgs.openjdk8; }
>
> and I also have some local nix expressions. But I only want this for one
> project (so no
> setting of .nixpkgs/config.nix).  Can someone point me in the right
> direction?
>
> Thanks!
> Ryan
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160719/a0c570ed/attachment.html>


More information about the nix-dev mailing list