Created
December 6, 2019 14:25
-
-
Save paulperegud/aa537dec30dd0a2a96bf9e20e146c756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import (fetchTarball https://nixos.org/channels/nixos-19.09/nixexprs.tar.xz) {}; | |
newpkgs = import pkgs.path { overlays = [ (pkgsself: pkgssuper: { | |
packageOverrides = self: super: { | |
erlang = super.erlangR20; | |
}; | |
} ) ]; }; | |
newpkgs.stdenv.mkDerivation { | |
name = "my_env"; | |
buildInputs = [ | |
erlang | |
elixir_1_8 | |
rebar3 | |
]; | |
} |
In both this and minimal form (without rebar3 and elixir_1_8) override somehow fails to deliver. When I enter nix-shell which erl
points at
/nix/store/0q4pag1dyc71kd1bwk43y8zsdw7d7nsi-erlang-22.0.4/bin/erl
I think packageOverrides
is the wrong option, just replace erlang
:
let
pkgs = import (fetchTarball https://nixos.org/channels/nixos-19.09/nixexprs.tar.xz) {};
newpkgs = import pkgs.path {
overlays = [ (self: super: {
erlang = super.erlangR20;
})];
};
fn = {stdenv, erlang, elixir_1_8, rebar3}: stdenv.mkDerivation {
name = "my_env";
buildInputs = [
erlang
elixir_1_8
rebar3
];
};
in newpkgs.callPackage fn {}
Replacing buildInputs = [ erlang ]
with buildInputs = [ (builtins.trace erlang.version erlang) ]
prints out 20.3.8.9
, so I think it's doing the right thing now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a few syntax errors:
let
requiresin
:let foo = 1; in 3 + foo
evaulates to4
stdenv.mkDerivation
doesn't know where to find the inputs you are using, this is done bycallPackage
which takes a function, inspects its arguments and passes those in automatically. The API for this iscallPackage fn overrides
-fn
is a function of the form{pkg1, pkg2}: derivation
andoverrides
is any additional inputs (so in this case just{}
since there are none).