From 83b8b865d6e0d9610c55f5c096bb71d569202df4 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 11 Jun 2020 15:07:53 +0200 Subject: [PATCH] local/bin/homeinit: Fix profile installation. --- .local/bin/homeinit | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.local/bin/homeinit b/.local/bin/homeinit index 09f708c9..5a71dbbe 100755 --- a/.local/bin/homeinit +++ b/.local/bin/homeinit @@ -220,17 +220,23 @@ popd guix_install_profile() { local profile local manifest - manifest=$HOME/.package-lists/guix-$i-manifest.scm + manifest=$HOME/.package-lists/guix-$1-manifest.scm if [ -f "$manifest" ]; then - if [ "$i" = "default" ]; then + if [ "$1" = "default" ]; then + info "Installing default profile..." ~/.config/guix/current/bin/guix package --manifest="$manifest" --keep-failed --substitute-urls="$SUBSTITUTE_URLS" . ~/.guix-profile/etc/profile else - profile=$HOME/.guix-extra-profiles/$i/$i - mkdir -p $(dirname "$profile") - ~/.config/guix/current/bin/guix package --manifest="$manifest" --keep-failed --profile="$profile" --substitute-urls="$SUBSTITUTE_URLS" - if [ -f "$profile"/etc/profile ]; then - . "$profile"/etc/profile + profile=$HOME/.guix-extra-profiles/$1/$1 + if [ ! -d "$HOME/.guix-extra-profiles/$1/$1" ]; then + info "Installing profile '$profile'..." + mkdir -p $(dirname "$profile") + ~/.config/guix/current/bin/guix package --manifest="$manifest" --keep-failed --profile="$profile" --substitute-urls="$SUBSTITUTE_URLS" + if [ -f "$profile"/etc/profile ]; then + . "$profile"/etc/profile + fi + else + info "Profile '$profile' already installed." fi fi else @@ -250,7 +256,8 @@ if inpath guix; then guix_install_profile "$i" done if is_laptop; then - guix_install_profile laptop laptop-gaming + guix_install_profile laptop + guix_install_profile laptop-gaming else guix_install_profile gaming fi