Skip to content

Instantly share code, notes, and snippets.

@Enzime
Last active August 17, 2018 06:45
Show Gist options
  • Save Enzime/40ffa464611d5b1e5b08aecd699c8eac to your computer and use it in GitHub Desktop.
Save Enzime/40ffa464611d5b1e5b08aecd699c8eac to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
with pkgs.python3Packages;
stdenv.mkDerivation {
name = "impurePythonEnv";
buildInputs = [
python3Full
pipenv.overrideAttrs ( oldAttrs: {
version = "master";
src = fetchFromGitHub {
owner = "pypa";
repo = "pipenv";
rev = "45c337a40f050ab6654346152f4f711e6566027d";
sha256 = "1jv9y3kn6ki4p9sb45986h8jhrvvagi5b57mrh4271fz63m8y83g";
};
})
psutil
stdenv
];
src = null;
shellHook = ''
# set SOURCE_DATE_EPOCH so that we can use python wheels
SOURCE_DATE_EPOCH=$(date +%s)
pipenv shell
'';
}
$ nix-shell broken.nix --show-trace
error: while evaluating the attribute 'buildInputs' of the derivation 'impurePythonEnv' at /nix/store/hncg8ii3iv6ldlk55kvyzmic7b40zpgn-nixpkgs-18.09pre146409.2391d1dbf31/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:175:11:
cannot coerce a function to a string, at /nix/store/hncg8ii3iv6ldlk55kvyzmic7b40zpgn-nixpkgs-18.09pre146409.2391d1dbf31/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:175:11
with import <nixpkgs> {};
with pkgs.python3Packages;
stdenv.mkDerivation {
name = "impurePythonEnv";
buildInputs = let
pipenv-master = pipenv.overrideAttrs ( oldAttrs: {
version = "master";
src = fetchFromGitHub {
owner = "pypa";
repo = "pipenv";
rev = "45c337a40f050ab6654346152f4f711e6566027d";
sha256 = "1jv9y3kn6ki4p9sb45986h8jhrvvagi5b57mrh4271fz63m8y83g";
};
});
in [
python3Full
pipenv-master
psutil
stdenv
];
src = null;
shellHook = ''
# set SOURCE_DATE_EPOCH so that we can use python wheels
SOURCE_DATE_EPOCH=$(date +%s)
pipenv shell
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment