2012-07-28 19:39:12 +02:00
|
|
|
|
#!/bin/sh
|
2014-11-12 16:15:39 +01:00
|
|
|
|
|
2019-01-19 18:39:26 +01:00
|
|
|
|
# TODO: Guix pull on commit specified in package-lists/guix-version?
|
|
|
|
|
# TODO: On foreign distro, use local package manager to install Guix. (Start with pacman.)
|
2019-01-22 10:04:44 +01:00
|
|
|
|
# TODO: Make functions to make it easier to re-order calls?
|
2019-01-19 18:39:26 +01:00
|
|
|
|
|
|
|
|
|
HTTPS_ROOT=https://gitlab.com/
|
|
|
|
|
SSH_ROOT=git@gitlab.com:
|
|
|
|
|
ROOT=$HTTPS_ROOT
|
2019-01-22 11:46:33 +01:00
|
|
|
|
PROFILE=/tmp/homeinit-$USER/homeinit
|
2019-01-29 10:16:00 +01:00
|
|
|
|
USER_NAME=Ambrevar
|
2019-01-19 18:39:26 +01:00
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
[ -z "$SOURCEDIR" ] && SOURCEDIR="$HOME/personal"
|
|
|
|
|
[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
|
|
|
|
|
[ -z "$XDG_DATA_HOME" ] && XDG_DATA_HOME="$HOME/.local/share"
|
|
|
|
|
[ -z "$EMACS_MIN_VERSION" ] && EMACS_MIN_VERSION=26
|
|
|
|
|
|
2019-05-28 18:25:35 +02:00
|
|
|
|
usage() {
|
2017-05-05 20:29:00 +02:00
|
|
|
|
cat <<EOF>&2
|
|
|
|
|
Usage: ${0##*/}
|
|
|
|
|
|
2019-01-19 18:39:26 +01:00
|
|
|
|
Initialize user profile: install packages, set up folders, etc.
|
2017-05-05 20:29:00 +02:00
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
|
2019-05-28 18:25:35 +02:00
|
|
|
|
-g DEVICE: Device where to sync ~/.gnupg.
|
|
|
|
|
-u: Skip large updates (packages, emails, etc.)
|
2019-01-18 10:42:04 +01:00
|
|
|
|
|
|
|
|
|
Environment variables:
|
|
|
|
|
|
|
|
|
|
SOURCEDIR=$SOURCEDIR
|
|
|
|
|
XDG_CONFIG_HOME=$XDG_CONFIG_HOME
|
|
|
|
|
XDG_DATA_HOME=$XDG_DATA_HOME
|
|
|
|
|
EMACS_MIN_VERSION=$EMACS_MIN_VERSION
|
2017-05-05 20:29:00 +02:00
|
|
|
|
|
2019-01-18 15:43:55 +01:00
|
|
|
|
Direct link:
|
|
|
|
|
|
2019-01-19 18:39:26 +01:00
|
|
|
|
${HTTPS_ROOT}ambrevar/dotfiles/raw/master/.local/bin/homeinit
|
2017-05-05 20:29:00 +02:00
|
|
|
|
EOF
|
|
|
|
|
exit
|
2019-05-28 18:25:35 +02:00
|
|
|
|
}
|
2017-05-05 20:29:00 +02:00
|
|
|
|
|
2018-02-11 20:00:14 +01:00
|
|
|
|
OPT_UPDATE=true
|
2019-05-28 18:25:35 +02:00
|
|
|
|
OPT_DEVICE=""
|
|
|
|
|
while getopts ":hg:u" opt; do
|
|
|
|
|
case $opt in
|
|
|
|
|
h)
|
|
|
|
|
usage
|
|
|
|
|
exit ;;
|
|
|
|
|
g)
|
|
|
|
|
OPT_DEVICE="$OPTARG" ;;
|
|
|
|
|
u)
|
|
|
|
|
OPT_UPDATE=true ;;
|
|
|
|
|
\?)
|
|
|
|
|
usage
|
|
|
|
|
exit 1 ;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
shift $(($OPTIND - 1))
|
2017-05-05 20:29:00 +02:00
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
RED='\033[0;31m\033[1m'
|
|
|
|
|
GREEN='\033[0;32m\033[1m'
|
|
|
|
|
YELLOW='\033[0;33m\033[1m'
|
|
|
|
|
BOLD='\033[0m\033[1m'
|
|
|
|
|
NORMAL='\033[0m'
|
|
|
|
|
|
|
|
|
|
section() {
|
|
|
|
|
echo -e "$GREEN==> $@$NORMAL"
|
|
|
|
|
}
|
|
|
|
|
message() {
|
|
|
|
|
echo -e "$YELLOW:: $@$NORMAL"
|
|
|
|
|
}
|
2019-01-22 15:33:05 +01:00
|
|
|
|
info() {
|
|
|
|
|
echo -e "$@"
|
|
|
|
|
}
|
2019-01-18 10:42:04 +01:00
|
|
|
|
warning() {
|
|
|
|
|
echo -e "${YELLOW}WARNING:: $@$NORMAL"
|
|
|
|
|
}
|
2012-07-28 20:04:21 +02:00
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
## "ln" wrapper.
|
|
|
|
|
## If $2 is a folder, create the link in it using the basename of $1.
|
|
|
|
|
## Existing files are no clobbered, unless they already are a symlink.
|
|
|
|
|
lnn() { # $1=TARGET $2=LINK|FOLDER
|
2018-01-11 11:19:20 +01:00
|
|
|
|
if [ -d "$2" ]; then
|
|
|
|
|
set -- "$1" "$2/$(basename "$1")"
|
|
|
|
|
fi
|
2017-07-24 18:25:31 +02:00
|
|
|
|
if [ ! -e "$2" ] || [ -h "$2" ]; then
|
|
|
|
|
ln -svnf "$1" "$2"
|
|
|
|
|
fi
|
|
|
|
|
}
|
2013-05-04 00:30:11 +02:00
|
|
|
|
|
2019-01-22 11:24:35 +01:00
|
|
|
|
inpath() {
|
|
|
|
|
for i; do
|
|
|
|
|
if ! command -v "$i" >/dev/null 2>&1; then
|
2019-01-22 15:32:44 +01:00
|
|
|
|
return 1
|
2019-01-22 11:24:35 +01:00
|
|
|
|
fi
|
|
|
|
|
done
|
2019-01-22 15:32:44 +01:00
|
|
|
|
return 0
|
2019-01-22 11:24:35 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
################################################################################
|
2019-01-19 18:39:26 +01:00
|
|
|
|
#
|
2019-01-18 10:42:04 +01:00
|
|
|
|
|
|
|
|
|
section "Initial packages"
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if inpath guix; then
|
2019-06-24 21:40:31 +02:00
|
|
|
|
mkdir -p ~/.config/guix
|
|
|
|
|
|
2019-01-22 15:09:27 +01:00
|
|
|
|
## OpenSSH is not an input of Git, upstream does not want to increase the
|
|
|
|
|
## closure size that much.
|
2019-05-28 18:25:35 +02:00
|
|
|
|
mkdir -p "$(dirname "$PROFILE")"
|
|
|
|
|
guix package --profile="$PROFILE" --install openssh gnupg git stow password-store pinentry-tty pinentry-gtk2 cryptsetup
|
2019-01-22 11:46:33 +01:00
|
|
|
|
source "$PROFILE"/etc/profile
|
2018-05-18 12:05:05 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2019-05-28 18:25:35 +02:00
|
|
|
|
|
|
|
|
|
if [ ! -d ~/.gnupg ]; then
|
|
|
|
|
section "GPG sync"
|
|
|
|
|
if [ -n "$OPT_DEVICE" ]; then
|
|
|
|
|
section "GnuPG"
|
|
|
|
|
sudo cryptsetup open "$OPT_DEVICE" gpg_backup
|
|
|
|
|
sudo mount -o compress=zstd /dev/mapper/gpg_backup /mnt
|
|
|
|
|
cp -a /mnt/public/.gnupg ~/
|
|
|
|
|
sudo umount /mnt
|
|
|
|
|
sudo cryptsetup close gpg_backup
|
|
|
|
|
else
|
|
|
|
|
warning "No device specified."
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "GPG"
|
2018-05-18 12:05:05 +02:00
|
|
|
|
if [ -d ~/.gnupg ]; then
|
2019-01-19 18:39:26 +01:00
|
|
|
|
ROOT=$SSH_ROOT
|
|
|
|
|
## Set up gpg-agent to authenticate to SSH_ROOT.
|
2019-01-22 12:49:46 +01:00
|
|
|
|
chmod -R go-rwx ~/.gnupg
|
2019-01-19 18:39:26 +01:00
|
|
|
|
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
2019-01-22 12:49:46 +01:00
|
|
|
|
if [ "$GPG_TTY" != "not a tty" ]; then
|
|
|
|
|
## If a TTY, since our ~/.gnupg/gpg-agent.conf exists and specifies a
|
|
|
|
|
## pinentry, we must force the TTY version or else it won't work from a TTY.
|
|
|
|
|
gpgconf --kill gpg-agent
|
|
|
|
|
cat<<EOF>"$(dirname "$PROFILE")/gpg-agent.conf"
|
|
|
|
|
## 1-day timeout
|
|
|
|
|
default-cache-ttl 86400
|
|
|
|
|
max-cache-ttl 86400
|
|
|
|
|
## SSH
|
|
|
|
|
enable-ssh-support
|
|
|
|
|
default-cache-ttl-ssh 86400
|
|
|
|
|
max-cache-ttl-ssh 86400
|
|
|
|
|
## Force pinentry (should be pinentry-tty)
|
|
|
|
|
pinentry-program $(readlink -f $(which pinentry))
|
|
|
|
|
EOF
|
2019-01-22 17:20:12 +01:00
|
|
|
|
gpg-agent --homedir ~/.gnupg --daemon --options "$(dirname "$PROFILE")/gpg-agent.conf"
|
2019-01-22 12:49:46 +01:00
|
|
|
|
fi
|
|
|
|
|
## Start gpg-agent manually since SSH requests do not do it automatically.
|
2019-01-19 18:39:26 +01:00
|
|
|
|
gpg-connect-agent updatestartuptty /bye
|
|
|
|
|
|
2018-05-18 12:32:48 +02:00
|
|
|
|
if [ -e "$SOURCEDIR" ]; then
|
|
|
|
|
git -C "$SOURCEDIR" pull
|
|
|
|
|
else
|
2019-01-29 10:16:00 +01:00
|
|
|
|
git clone ${SSH_ROOT}$USER_NAME/personal ~/personal
|
2018-05-18 12:32:48 +02:00
|
|
|
|
fi
|
|
|
|
|
if [ -e ~/.password-store ]; then
|
|
|
|
|
git -C ~/.password-store pull
|
|
|
|
|
else
|
2019-01-29 10:16:00 +01:00
|
|
|
|
git clone ${SSH_ROOT}$USER_NAME/password-store ~/.password-store
|
2018-07-12 12:02:07 +02:00
|
|
|
|
## The following is necessary to make sure the 'diff' GPG filter is properly set up.
|
|
|
|
|
pass git init
|
2018-05-18 12:32:48 +02:00
|
|
|
|
fi
|
2018-05-18 12:05:05 +02:00
|
|
|
|
else
|
2019-01-18 10:42:04 +01:00
|
|
|
|
warning "~/.gnupg not found."
|
2018-05-18 12:05:05 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "Persistent folders"
|
2019-09-18 10:10:48 +02:00
|
|
|
|
for i in .cache/mail .config .config/guix .config/transmission-daemon .emacs.d .local/share .mpv projects temp; do
|
2018-05-18 12:05:05 +02:00
|
|
|
|
mkdir -pv "$HOME/$i"
|
|
|
|
|
done
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "dotfiles"
|
2018-05-18 12:05:05 +02:00
|
|
|
|
if [ -e ~/dotfiles ]; then
|
2019-01-29 10:16:00 +01:00
|
|
|
|
git -C ~/dotfiles remote set-url origin ${ROOT}$USER_NAME/dotfiles
|
2018-05-18 12:32:48 +02:00
|
|
|
|
git -C ~/dotfiles pull
|
2018-05-18 12:05:05 +02:00
|
|
|
|
else
|
2019-01-29 10:16:00 +01:00
|
|
|
|
git clone ${ROOT}$USER_NAME/dotfiles ~/dotfiles || exit 1
|
2018-05-18 12:05:05 +02:00
|
|
|
|
fi
|
|
|
|
|
pushd ~/dotfiles
|
2019-01-22 12:49:46 +01:00
|
|
|
|
## .bash_profile may prevent .profile from being parsed, so we move it.
|
2019-01-19 18:39:26 +01:00
|
|
|
|
[ -e ~/.bash_profile ] && mv -v ~/.bash_profile ~/.bash_profile.old
|
|
|
|
|
stow -v . || exit 1
|
2018-05-18 12:05:05 +02:00
|
|
|
|
popd
|
2017-07-29 10:31:30 +02:00
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "System packages"
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if inpath guix; then
|
2019-01-22 13:39:04 +01:00
|
|
|
|
if [ ! -e ~/.cache/guix/pull ]; then
|
|
|
|
|
message "Update Guix to yesterday's version"
|
2019-01-22 17:19:41 +01:00
|
|
|
|
## TODO: This clones the repository twice, which is a bit dumb, but cloning
|
|
|
|
|
## locally and then running `guix pull --url=/tmp/guix` produces a different
|
|
|
|
|
## hash in ~/.cache/guix/...
|
2019-01-22 13:39:04 +01:00
|
|
|
|
git clone https://git.savannah.gnu.org/git/guix.git /tmp/guix
|
|
|
|
|
YESTERDAY_COMMIT=$(git -C /tmp/guix log --until=yesterday -n 1 --format=%H)
|
|
|
|
|
guix pull --commit=$YESTERDAY_COMMIT
|
2019-05-28 18:25:35 +02:00
|
|
|
|
hash guix
|
2019-01-22 13:39:04 +01:00
|
|
|
|
unset YESTERDAY_COMMIT
|
2019-05-28 18:25:35 +02:00
|
|
|
|
rm -rf /tmp/guix
|
2019-01-22 15:33:05 +01:00
|
|
|
|
elif $OPT_UPDATE; then
|
2019-01-22 13:39:04 +01:00
|
|
|
|
CURRENT_COMMIT=$(guix --version 2>/dev/null | awk '{print $4; exit}')
|
2019-05-28 18:25:35 +02:00
|
|
|
|
for i in $HOME/.cache/guix/pull/*; do
|
|
|
|
|
if [ "$(git -C "$i" config --get remote.origin.url)" = "https://git.savannah.gnu.org/git/guix.git" ]; then
|
|
|
|
|
REPO="$i"
|
|
|
|
|
break
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
2019-01-22 15:33:05 +01:00
|
|
|
|
CURRENT_COMMIT_DATE=$(git -C "$REPO" log -n 1 --format=%ct $CURRENT_COMMIT)
|
2019-01-22 13:39:04 +01:00
|
|
|
|
git -C $REPO pull
|
2019-05-28 18:25:35 +02:00
|
|
|
|
hash guix
|
2019-01-22 15:33:05 +01:00
|
|
|
|
LATEST_COMMIT_DATE=$(git -C "$REPO" log -n 1 --format=%ct)
|
2019-01-22 13:39:04 +01:00
|
|
|
|
|
|
|
|
|
[ -z "$GUIX_DISTRO_AGE_WARNING" ] && GUIX_DISTRO_AGE_WARNING=$((7 * 24 * 60 * 60))
|
|
|
|
|
|
2019-01-22 15:33:05 +01:00
|
|
|
|
info "Current commit date: $(date --date="@$CURRENT_COMMIT_DATE") ($CURRENT_COMMIT_DATE)"
|
|
|
|
|
info "Last commit date: $(date --date="@$LATEST_COMMIT_DATE") ($LATEST_COMMIT_DATE)"
|
|
|
|
|
info "Difference (in seconds): $(($LATEST_COMMIT_DATE - $CURRENT_COMMIT_DATE))"
|
|
|
|
|
if [ $(($LATEST_COMMIT_DATE - $CURRENT_COMMIT_DATE)) -gt $GUIX_DISTRO_AGE_WARNING ]; then
|
|
|
|
|
message "Update Guix since it's older than GUIX_DISTRO_AGE_WARNING ($GUIX_DISTRO_AGE_WARNING)."
|
2019-01-22 13:39:04 +01:00
|
|
|
|
YESTERDAY_COMMIT=$(git -C "$REPO" log --until=yesterday -n 1 --format=%H)
|
|
|
|
|
guix pull --commit=$YESTERDAY_COMMIT
|
|
|
|
|
unset YESTERDAY_COMMIT
|
|
|
|
|
fi
|
|
|
|
|
unset LATEST_COMMIT_DATE
|
|
|
|
|
unset CURRENT_COMMIT_DATE
|
|
|
|
|
unset REPO
|
|
|
|
|
unset CURRENT_COMMIT
|
|
|
|
|
fi
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
## TODO: The manifest will uninstall other unspecified packages. Is this
|
|
|
|
|
## really what we want?
|
2019-06-25 09:47:22 +02:00
|
|
|
|
# export GUIX_PACKAGE_PATH=$HOME/.guix-packages
|
2019-05-28 18:25:35 +02:00
|
|
|
|
~/.config/guix/current/bin/guix package --manifest=$HOME/.package-lists/guix-manifest.scm --keep-failed
|
2019-01-22 18:59:28 +01:00
|
|
|
|
. ~/.guix-profile/etc/profile
|
2018-01-11 11:06:43 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2019-06-25 10:30:45 +02:00
|
|
|
|
section "Quicklisp"
|
|
|
|
|
QUICKLISP_DIR=$HOME/.quicklisp
|
|
|
|
|
QUICKLISP_URL=https://beta.quicklisp.org/quicklisp.lisp
|
|
|
|
|
DOWNLOAD_AGENT=curl
|
|
|
|
|
DOWNLOAD_AGENT_FLAGS=--output
|
|
|
|
|
LISP=sbcl
|
|
|
|
|
LISP_FLAGS=--no-userinit
|
|
|
|
|
if [ ! -d "$QUICKLISP_DIR" ] && inpath $LISP && inpath $DOWNLOAD_AGENT; then
|
|
|
|
|
$DOWNLOAD_AGENT $DOWNLOAD_AGENT_FLAGS /tmp/setup.lisp $QUICKLISP_URL
|
|
|
|
|
$LISP $LISP_FLAGS \
|
|
|
|
|
--eval '(require "asdf")' \
|
|
|
|
|
--load /tmp/setup.lisp \
|
|
|
|
|
--eval '(quicklisp-quickstart:install :path "'$QUICKLISP_DIR'/")' \
|
|
|
|
|
--eval '(uiop:quit)'
|
|
|
|
|
rm -v /tmp/setup.lisp
|
|
|
|
|
fi
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "Bookmarks"
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if inpath qutebrowser; then
|
2019-01-18 10:42:04 +01:00
|
|
|
|
mkdir -pv "$XDG_CONFIG_HOME/qutebrowser/bookmarks"
|
|
|
|
|
lnn "$SOURCEDIR/bookmarks/bookmarks" "$XDG_CONFIG_HOME/qutebrowser/bookmarks/urls"
|
|
|
|
|
lnn "$SOURCEDIR/bookmarks/quickmarks" "$XDG_CONFIG_HOME/qutebrowser/"
|
|
|
|
|
fi
|
2013-01-09 19:25:23 +01:00
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "Emacs"
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if ! inpath emacs; then
|
2019-01-18 10:42:04 +01:00
|
|
|
|
message "Emacs: Installing latest development version"
|
2018-05-18 12:05:05 +02:00
|
|
|
|
pushd "$HOME/projects"
|
|
|
|
|
[ -e emacs ] || git clone https://git.savannah.gnu.org/git/emacs.git
|
2019-01-18 10:42:04 +01:00
|
|
|
|
mkdir -pv ../emacs-build
|
|
|
|
|
cd ../emacs-build
|
|
|
|
|
../emacs/configure \
|
|
|
|
|
--disable-gtk-deprecation-warnings \
|
|
|
|
|
--without-pop \
|
|
|
|
|
--without-kerberos \
|
|
|
|
|
--without-kerberos5 \
|
|
|
|
|
--with-x-toolkit=gtk3 \
|
|
|
|
|
--with-jpeg \
|
|
|
|
|
--with-tiff \
|
|
|
|
|
--with-gif \
|
|
|
|
|
--with-png \
|
|
|
|
|
--with-rsvg \
|
|
|
|
|
--with-xml2 \
|
|
|
|
|
--with-imagemagick \
|
|
|
|
|
--with-xft \
|
|
|
|
|
--with-libotf \
|
|
|
|
|
--without-gsettings \
|
|
|
|
|
--without-gconf \
|
|
|
|
|
--with-gnutls \
|
|
|
|
|
--with-modules \
|
|
|
|
|
--with-threads
|
|
|
|
|
sudo make install
|
|
|
|
|
popd
|
2018-02-16 14:18:28 +01:00
|
|
|
|
fi
|
|
|
|
|
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if inpath emacs; then
|
2019-01-18 10:42:04 +01:00
|
|
|
|
message "Emacs cache folder"
|
2018-02-16 14:18:28 +01:00
|
|
|
|
mkdir -pv "$HOME/.cache/emacs/"
|
2019-01-22 11:24:35 +01:00
|
|
|
|
if ! inpath guix; then
|
2018-05-18 12:05:05 +02:00
|
|
|
|
if $OPT_UPDATE; then
|
2019-01-18 10:42:04 +01:00
|
|
|
|
message "Emacs ELPA packages"
|
2018-05-18 12:05:05 +02:00
|
|
|
|
yes | emacs --batch -l ~/.emacs.d/init.el --eval '(progn (package-refresh-contents) (package-install-selected-packages))'
|
|
|
|
|
fi
|
2018-01-11 11:06:43 +01:00
|
|
|
|
fi
|
2019-01-18 10:42:04 +01:00
|
|
|
|
message "Emacs local packages"
|
2019-01-19 18:39:26 +01:00
|
|
|
|
if [ -e ~/.local/share/emacs/site-lisp ]; then
|
|
|
|
|
for i in ~/.local/share/emacs/site-lisp/*; do
|
|
|
|
|
echo "$i"
|
|
|
|
|
git -C "$i" pull
|
|
|
|
|
done
|
|
|
|
|
else
|
|
|
|
|
mkdir -pv ~/.local/share/emacs/site-lisp
|
|
|
|
|
fi
|
2016-05-06 09:24:40 +02:00
|
|
|
|
fi
|
2016-06-09 21:32:07 +02:00
|
|
|
|
|
2019-01-22 11:46:33 +01:00
|
|
|
|
if inpath guix; then
|
|
|
|
|
section "Cleanup initial packages"
|
|
|
|
|
rm -rv "$(dirname "$PROFILE")"
|
|
|
|
|
fi
|
|
|
|
|
|
2019-01-22 10:04:44 +01:00
|
|
|
|
if [ -x ~/.local/bin/updatedb-local ]; then
|
2019-01-29 10:16:00 +01:00
|
|
|
|
section "locate db"
|
2019-01-22 10:04:44 +01:00
|
|
|
|
~/.local/bin/updatedb-local
|
|
|
|
|
fi
|
|
|
|
|
|
2019-02-04 19:14:50 +01:00
|
|
|
|
if [ -f ~/personal/history/eshell.gpg ]; then
|
|
|
|
|
section "Shell history"
|
|
|
|
|
mkdir -pv ~/.cache/emacs/eshell/
|
|
|
|
|
gpg --output ~/.cache/emacs/eshell/history --decrypt ~/personal/history/eshell.gpg
|
|
|
|
|
fi
|
|
|
|
|
|
2019-01-18 10:42:04 +01:00
|
|
|
|
section "Mail"
|
2018-02-08 18:01:18 +01:00
|
|
|
|
lnn "$SOURCEDIR/mail/authinfo.gpg" "$HOME/.authinfo.gpg"
|
2017-07-24 18:25:31 +02:00
|
|
|
|
mkdir -pv "$HOME/.cache/mail/"
|
2018-05-18 12:05:05 +02:00
|
|
|
|
while IFS= read -r i; do
|
2019-01-19 18:39:26 +01:00
|
|
|
|
## Warning: We need to eval here to expand the "~".
|
|
|
|
|
mkdir -pv $(eval echo $i)
|
2018-05-18 12:05:05 +02:00
|
|
|
|
done <<EOF
|
2019-01-18 10:42:04 +01:00
|
|
|
|
$(awk '/^Path/ {print $2}' ~/.mbsyncrc)
|
2017-07-24 18:25:31 +02:00
|
|
|
|
EOF
|
2017-07-29 10:31:30 +02:00
|
|
|
|
|
2018-01-11 11:06:43 +01:00
|
|
|
|
if $OPT_UPDATE; then
|
|
|
|
|
mbsync -aV
|
2019-03-17 20:14:04 +01:00
|
|
|
|
# mu index --maildir=~/.cache/mail
|
|
|
|
|
notmuch new
|
2018-01-11 11:06:43 +01:00
|
|
|
|
fi
|