git ssb

0+

clacke / gists



Tree: 0c4a0b6e10f7fbf15127339750a6ff490d9aa3c8

Files: 0c4a0b6e10f7fbf15127339750a6ff490d9aa3c8 / 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