Skip to content

Instantly share code, notes, and snippets.

@dminuoso
Created May 17, 2021 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dminuoso/938dba3f0beb94c92004f3c2be115f09 to your computer and use it in GitHub Desktop.
Save dminuoso/938dba3f0beb94c92004f3c2be115f09 to your computer and use it in GitHub Desktop.
# Usage: use_nix [...]
#
# Load environment variables from `nix-shell`.
# If you have a `default.nix` or `shell.nix` these will be
# used by default, but you can also specify packages directly
# (e.g `use nix -p ocaml`).
#
use_nix() {
direnv_load nix-shell --show-trace "$@" --run "$(join_args "$direnv" dump)"
if [[ $# == 0 ]]; then
watch_file default.nix shell.nix
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment