git ssb

0+

clacke / gists



Tree: 83e303c45fd32bc34d2cd8c96b7aa2c84a431af0

Files: 83e303c45fd32bc34d2cd8c96b7aa2c84a431af0 / bin / nix-environment

549 bytesRaw
1#!/usr/bin/env bash
2
3# Execute things in an ephemeral nix environment context, with similar
4# syntax as `guix environment --ad-hoc`:
5# nix-environment <package_1> [ ... <package_n> ] -- \
6# command [ <arg_1> [ ... <arg_n>]]
7
8EL_BIN=/nix/var/nix/profiles/execline/bin
9
10while (( $# >= 1 )); do
11 if [[ $1 == "--" ]]; then
12 shift
13 break
14 fi
15 packages+=( "$1" )
16 shift
17done
18
19export PARAMS=$(PATH=${EL_BIN}:$PATH execlineb -c 'dollarat -d ""' "$@")
20
21exec nix-shell -p "${packages[@]}" --run "exec '${EL_BIN}/import' -s -d '' PARAMS '\$PARAMS'"

Built with git-ssb-web