#!/usr/bin/env bash if [ -z "$1" ] then echo "usage: install.sh " exit 1 fi echo "Symlinking directories" mkdir -p ~/.config/nixpkgs NIXDIR="$HOME/.config/nixpkgs" HOMEFILE="$NIXDIR/home.nix" NIXFILE="$(pwd)/$1" [[ -e "$HOMEFILE" ]] || ln -s "$NIXFILE" "$HOMEFILE" [[ -e "$NIXDIR/config.nix" ]] || ln -s "$(pwd)/lib/config.nix" "$NIXDIR/config.nix" # The notmuch config location is by default ~/.notmuch-config, but home-manager # puts it at ~/.config/notmuch/notmuchrc (which makes sense) and then sets # NOTMUCH_CONFIG. However, if a program for some reason doesn't read # NOTMUCH_CONFIG (emacs), then it won't find the right config file, so I # override with a symlink. # mkdir -p ~/.config/notmuch [[ -e ~/.notmuch-config ]] || ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config # Symlinking must occur before initial generation # nix-shell ./home-manager -A install