diff options
author | Justin Bedo <cu@cua0.org> | 2018-09-06 08:10:57 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2018-09-06 08:11:18 +1000 |
commit | d7b738eea555bb63026279589d4b835f8459b9f0 (patch) | |
tree | 3dbbef2d3c6c2187e35eae9186d29f55792ff83f /conda.nix | |
parent | 188400e30f371487a8bf6304684c305b2a03addb (diff) |
refactor conda stuff
Diffstat (limited to 'conda.nix')
-rw-r--r-- | conda.nix | 41 |
1 files changed, 25 insertions, 16 deletions
@@ -1,19 +1,28 @@ -{pkgs ? import <nixpkgs> {}}: +{ stdenv, lib, writeScript, conda }: -with pkgs; +{ + buildCondaEnv = { depends ? [], run }: stdenv.mkDerivation { + name = "conda-env"; + buildInputs = [ conda ] ++ depends; + buildCommand = '' + mkdir $out + HOME=$out + conda-shell-4.3.31 << EOF + conda-install + ${run} + EOF + ''; + }; -stdenv.mkDerivation { - name = "conda"; - src = ./conda.nix; - phases = [ "buildPhase" ]; - buildInputs = [ conda ]; - buildPhase = '' - HOME=$TMPDIR - conda-shell-4.3.31 << EOF - conda-install - conda config --add channels bioconda - conda install -y bwa - bwa - EOF - ''; + withCondaEnv = env: run: stdenv.mkDerivation { + name = "with-conda-env"; + buildCommand = '' + #!${stdenv.shell} + export HOME=${env} + ${conda}/bin/conda-shell-4.3.31 << EOF + ${run} + EOF + ''; + }; } + |