local/bin/homeinit: Install more Guix profiles, including laptop profiles.
parent
d823e88826
commit
575cd8f538
|
@ -130,6 +130,10 @@ has_gpg_keys() {
|
|||
[ -n "$(ls -1 ~/.gnupg/private-*)" ]
|
||||
}
|
||||
|
||||
is_laptop() {
|
||||
[ -n "$(ls -1 /sys/class/power_supply/)" ]
|
||||
}
|
||||
|
||||
if ! has_gpg_keys; then
|
||||
section "GPG sync"
|
||||
if [ -n "$OPT_DEVICE" ]; then
|
||||
|
@ -205,10 +209,26 @@ pushd ~/dotfiles
|
|||
stow -v . || exit 1
|
||||
popd
|
||||
|
||||
guix_install_profile() {
|
||||
local profile
|
||||
local manifest
|
||||
manifest=$HOME/.package-lists/guix-$i-manifest.scm
|
||||
if [ -f "$manifest"]; then
|
||||
warning "Manifest $manifest not found."
|
||||
else
|
||||
profile=$HOME/.guix-extra-profiles/$i/$i
|
||||
mkdir -p $(dirname "$profile")
|
||||
~/.config/guix/current/bin/guix package --manifest=$HOME/.package-lists/guix-$i-manifest.scm --keep-failed --profile="$profile" --substitute-urls="$SUBSTITUTE_URLS"
|
||||
if [ -f "$profile"/etc/profile ]; then
|
||||
. "$profile"/etc/profile
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
section "System packages"
|
||||
if inpath guix; then
|
||||
if [ ! -e ~/.cache/guix ]; then
|
||||
message "First Guix pull"
|
||||
message "First 'guix pull'"
|
||||
guix pull --substitute-urls="$SUBSTITUTE_URLS"
|
||||
hash guix
|
||||
fi
|
||||
|
@ -216,15 +236,21 @@ if inpath guix; then
|
|||
~/.config/guix/current/bin/guix package --manifest=$HOME/.package-lists/guix-default-manifest.scm --keep-failed --substitute-urls="$SUBSTITUTE_URLS"
|
||||
. ~/.guix-profile/etc/profile
|
||||
|
||||
for i in main emacs texlive; do
|
||||
profile=$HOME/.guix-extra-profiles/$i/$i
|
||||
mkdir -p $(dirname "$profile")
|
||||
~/.config/guix/current/bin/guix package --manifest=$HOME/.package-lists/guix-$i-manifest.scm --keep-failed --profile="$profile" --substitute-urls="$SUBSTITUTE_URLS"
|
||||
if [ -f "$profile"/etc/profile ]; then
|
||||
. "$profile"/etc/profile
|
||||
fi
|
||||
unset profile
|
||||
for i in main emacs next texlive; do
|
||||
guix_install_profile "$i"
|
||||
done
|
||||
if $is_laptop; then
|
||||
guix_install_profile laptop laptop-gaming
|
||||
else
|
||||
guix_install_profile gaming
|
||||
fi
|
||||
if $OPT_UPDATE; then
|
||||
for i in blender chromium electrum racket; do
|
||||
guix_install_profile "$i"
|
||||
done
|
||||
fi
|
||||
else
|
||||
warning "Package manager not supported. Install Guix."
|
||||
fi
|
||||
|
||||
if inpath emacs; then
|
||||
|
|
Loading…
Reference in New Issue