dotfiles

shared miscellaneous configuration files between my systems
git clone git://git.eonn.xyz/dotfiles.git
Log | Files | Refs

commit d761086ed4ad30bc55b3dd62fbdfd734bae4204b
parent 15d1c808dfd0524706fcd60319225215791ec494
Author: iressa <ian@eonn.xyz>
Date:   Sun, 13 Feb 2022 19:21:17 -0500

add bin/guix-update-extra-profiles.sh

Diffstat:
Abin/guix-update-extra-profiles.sh | 48++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+), 0 deletions(-)

diff --git a/bin/guix-update-extra-profiles.sh b/bin/guix-update-extra-profiles.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +GUIX_EXTRA_PROFILES="$HOME/.guix-extra-profiles" +GUIX_EXTRA_MANIFESTS="$HOME/guix-config/manifest" + +declare -a PROFILEDIRS +if [ "$#" -eq 0 ]; then + mapfile -d '' PROFILEDIRS < <(find "$GUIX_EXTRA_PROFILES"/ -maxdepth 1 -not -path "$GUIX_EXTRA_PROFILES"/ -print0) +else + for i in "$@"; do + profiledirs="$(find "$GUIX_EXTRA_PROFILES"/ -maxdepth 1 -not -path "$GUIX_EXTRA_PROFILES"/ -name "$i")" + if $(echo "$profiledirs" | grep -v .); then + echo "WARNING: Can't find profile \""$i"\" in GUIX_EXTRA_PROFILES, skipping" + else + PROFILEDIRS+=("$profiledirs") + fi + done +fi + +for i in "${PROFILEDIRS[@]}"; do + profile="$i"/$(basename "$i") + manifest="$GUIX_EXTRA_MANIFESTS"/"$(basename "$i")".scm + if [ -f "$manifest" ]; then + echo "Queueing "$i"..." + CMDS+=("guix package --manifest="$manifest" --profile="$profile"") + else + echo "WARNING: Can't find manifest \""$manifest"\" for \""$profile"\", skipping" + fi +done + +if (( ${#CMDS[@]} == 0 )); then + echo "Nothing to do, quitting..." +else + echo "The following will be run:" + for cmd in "${CMDS[@]}"; do + echo "$cmd" + done + read -p "Proceed? [Y/n] " re + case "$re" in [yY][eE][sS]|[yY]|'') + echo + for cmd in "${CMDS[@]}"; do + echo "$cmd" + $cmd + done + echo "Done with updates, exiting..." + ;; + esac +fi