#!/bin/sh
set -eux

if [ -z "${1:-}" ]; then
	guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \
		environment --fallback -m aux/guix/manifest.scm
elif [ "$1" = '-p' ]; then
	guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \
		environment --fallback -m aux/guix/manifest.scm --pure -C
else
	guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \
		environment --fallback -m aux/guix/manifest.scm --pure -C -- sh -c "$@"
fi
