summaryrefslogtreecommitdiff
path: root/install.sh
blob: 1b40c4e6a46e5234ec39ba9970e6795b299702ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

nix-shell ./home-manager -A install

mkdir -p ~/.config/nixpkgs

NIXDIR="$HOME/.config/nixpkgs"

HOMEFILE="$NIXDIR/home.nix"
NIXFILE="$(pwd)/$(uname | tr A-Z a-z).nix"

[[ -e "$HOMEFILE" ]] || ln -s "$NIXFILE" "$HOMEFILE"
[[ -e "$NIXDIR/config.nix" ]] || ln -s "$(pwd)/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.
[[ -e ~/.notmuch-config ]] || ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config