aboutsummaryrefslogtreecommitdiff
path: root/aux/containers/guix/with-container.sh
blob: bd7919af559ab1b85ca7b85d5e3493c2db11f3fe (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
set -eu

CHANNEL_REMOTE='https://euandre.org/git/package-repository'
CHANNEL_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/euandreh-guix-channel"

if [ ! -d "$CHANNEL_DIR" ]; then
	git clone "$CHANNEL_REMOTE" "$CHANNEL_DIR"
fi

git -C "$CHANNEL_DIR" pull

ENV_CMD="guix environment -L $CHANNEL_DIR/src/ -m aux/containers/guix/manifest.scm"

if [ -z "${1:-}" ]; then
	$ENV_CMD
else
	$ENV_CMD --pure -C -- sh -c "$@"
fi