...
default.nix
- the nix package managerSpecify packages to be installed by the nix package manager.
Note that when using this config file all other configuration files (like
requirements.txt
) that specify packages are ignored.Also make sure to pin your nixpkgs to produce a reproducible environment.
Build Lifecycle
...
Hooks
postBuild
- run code after installing the environmentA script that can contain arbitrary commands to be run after the whole repository has been built. If you want this to be a shell script, make sure the first line is
#!/bin/bash
.Note that by default the build will not be stopped if an error occurs inside a shell script. You should include
set -e
or the equivalent at the start of the script to avoid errors being silently ignored.
start
- run code before the user session startsA script that can contain simple commands to be run at runtime (as an
ENTRYPOINT
to the docker container). If you want this to be a shell script, make sure the first line is#!/bin/bash
. The last line must beexec "$@"
or equivalent.Use this to set environment variables that software installed in your container expects to be set. This script is executed each time your binder is started and should at most take a few seconds to run.
If you only need to run things once during the build phase use
postBuild
instead.