summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-11-09 11:10:58 -0800
committerBen Sima <ben@bsima.me>2018-11-09 11:10:58 -0800
commitfa47b22aa64c86dc369fdc0cbb60e90eaeca1e75 (patch)
tree9e92974e58e50425a9cac3eb8ca9693ced9934a6 /install.sh
parent55e5afc345b4376778979807f2c8d4992ebb437e (diff)
Machine-specific home.nix, install from git repo instead of tarball
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/install.sh b/install.sh
index a9bf4d8..1b40c4e 100755
--- a/install.sh
+++ b/install.sh
@@ -1,20 +1,20 @@
#!/usr/bin/env bash
-#
-# Downloads and installs home-manager, then symlinks this directory where
-# home-manager expects it.
-HM_PATH=https://github.com/rycee/home-manager/archive/master.tar.gz
+nix-shell ./home-manager -A install
-nix-shell $HM_PATH -A install
+mkdir -p ~/.config/nixpkgs
-# macOS doesn't have a ~/.config directory by default
-mkdir -p ~/.config
+NIXDIR="$HOME/.config/nixpkgs"
-[[ -L ~/config ]] && ln -s ~/config/home.nix ~/.config/nixpkgs/home.nix
+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.
-[[ -L ~/.notmuch-config ]] && ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config
+[[ -e ~/.notmuch-config ]] || ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config