Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created August 6, 2017 01:13
Show Gist options
  • Save cleverca22/ff172de384fa9240d70f35772abd98e9 to your computer and use it in GitHub Desktop.
Save cleverca22/ff172de384fa9240d70f35772abd98e9 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
let
callPackage = newScope self;
self = {
foo = callPackage ./foo.nix {};
other = callPackage ./other.nix {};
};
in self
{
someVar ? false
, stdenv, fetchurl, something, somethingelse, perl
}:
with stdenv.lib;
let
version = "2.0";
in stdenv.mkDerivation rec {
name = "foo-${version}";
src = fetchurl {
# ...
};
buildInputs = [ something ]
++ optional (stdenv.isLinux || stdenv.isFreeBSD) somethingelse;
nativeBuildInputs = [ perl ];
configureFlags = []
++ optional someVar "--some-setting"
;
enableParallelBuilding = true;
meta = {
# ...
};
}
{ stdenv, foo }:
stdenv.mkDerivation rec {
...
buildInputs = [ foo ];
configureFlags = [
"VAR=${foo}/bin/somebin"
];
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment