summaryrefslogtreecommitdiffstats
path: root/bin/activate-profiles
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2022-10-15 14:03:46 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2022-10-15 14:03:46 +0200
commite43f3c403ff49e87641bb6c745080760f272446f (patch)
treec964d54e79c87ec466658e289e10303c861be5cd /bin/activate-profiles
parente62c8a78ec0b8727d138fbe4144cf718b7da867d (diff)
downloaddotfiles-e43f3c403ff49e87641bb6c745080760f272446f.tar.gz
dotfiles-e43f3c403ff49e87641bb6c745080760f272446f.zip
Update dotfiles
Diffstat (limited to 'bin/activate-profiles')
-rwxr-xr-xbin/activate-profiles39
1 files changed, 0 insertions, 39 deletions
diff --git a/bin/activate-profiles b/bin/activate-profiles
deleted file mode 100755
index a4373cf..0000000
--- a/bin/activate-profiles
+++ /dev/null
@@ -1,39 +0,0 @@
1#!/bin/sh
2# Source: https://github.com/daviwil/dotfiles/blob/master/Systems.org#profile-management
3
4GREEN='\033[1;32m'
5RED='\033[1;30m'
6NC='\033[0m'
7GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles
8
9profiles=$*
10if [[ $# -eq 0 ]]; then
11 profiles="$HOME/.config/guix/manifests/*.scm";
12fi
13
14for profile in $profiles; do
15 # Remove the path and file extension, if any
16 profileName=$(basename $profile)
17 profileName="${profileName%.*}"
18 profilePath="$GUIX_EXTRA_PROFILES/$profileName"
19 manifestPath=$HOME/.config/guix/manifests/$profileName.scm
20
21 if [ -f $manifestPath ]; then
22 echo
23 echo -e "${GREEN}Activating profile:" $manifestPath "${NC}"
24 echo
25
26 mkdir -p $profilePath
27 guix package --manifest=$manifestPath --profile="$profilePath/$profileName"
28
29 # Source the new profile
30 GUIX_PROFILE="$profilePath/$profileName"
31 if [ -f $GUIX_PROFILE/etc/profile ]; then
32 . "$GUIX_PROFILE"/etc/profile
33 else
34 echo -e "${RED}Couldn't find profile:" $GUIX_PROFILE/etc/profile "${NC}"
35 fi
36 else
37 echo "No profile found at path" $profilePath
38 fi
39done