-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.nix
36 lines (28 loc) · 879 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> {} }:
let
fhs = pkgs.buildFHSUserEnv {
name = "fhs";
targetPkgs = pkgs: [
pkgs.micromamba
pkgs.gcc_multi
pkgs.binutils
];
profile = ''
set -ex
# Set up micromamba and initialize the shell
export MAMBA_EXE=$(which micromamba)
export MAMBA_ROOT_PREFIX=~/micromamba
eval "$($MAMBA_EXE shell hook --shell=posix --prefix=$MAMBA_ROOT_PREFIX)"
# Configure an exclusive conda set up
micromamba config append channels conda-forge
micromamba config set channel_priority strict
# Create the required environment:
if ! test -d $MAMBA_ROOT_PREFIX/envs/waterbodies-env; then
micromamba create --yes -f environment.yml
fi
# Activate the environment.
micromamba activate waterbodies-env
set +e
'';
};
in fhs.env