summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-05-16 09:49:15 -0400
committerBen Sima <ben@bsima.me>2021-05-16 09:49:15 -0400
commitfa8a6f493f1b5060fa306e39a5502df56f4f02c1 (patch)
treee1dbd7a4dbd9acb48e4745527de3927ba6880244 /install.sh
parentd2b49d5dda113d42a4d221be36ee3298c43350d3 (diff)
move stuff into profiles
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/install.sh b/install.sh
index a16d8a6..4b19d53 100755
--- a/install.sh
+++ b/install.sh
@@ -2,16 +2,21 @@
#
set -euxo pipefail
#
-[[ -z "$1" ]] && echo "usage: install.sh <file.nix>" && exit 1
+[[ -z "$1" ]] \
+ && echo "usage: install.sh <file.nix>" \
+ && echo "where <file.nix> is something from the 'profiles' directory" \
+ && exit 1
#
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"
+# start from scratch
+rm "$HOMEFILE"
+ln -s "$NIXFILE" "$HOMEFILE"
+rm "$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