aboutsummaryrefslogtreecommitdiff
path: root/aux/containers/guix/with-container.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-01-13 15:02:40 -0300
committerEuAndreh <eu@euandre.org>2022-01-13 15:02:40 -0300
commitc98d6c8175a1b2fe4452990b6ac19346411b637d (patch)
treeb089c7bf575b58d94951a651be32869a94a2f396 /aux/containers/guix/with-container.sh
parentsrc/xyz/euandreh/queue.scm: Change pymd4c to upstream repository (diff)
downloadpackage-repository-c98d6c8175a1b2fe4452990b6ac19346411b637d.tar.gz
package-repository-c98d6c8175a1b2fe4452990b6ac19346411b637d.tar.xz
aux/: Update
Diffstat (limited to '')
-rwxr-xr-xaux/containers/guix/with-container.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/aux/containers/guix/with-container.sh b/aux/containers/guix/with-container.sh
new file mode 100755
index 0000000..fcbb8b5
--- /dev/null
+++ b/aux/containers/guix/with-container.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -eu
+
+CHANNEL_REMOTE='https://euandreh.xyz/package-repository.git'
+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