From 78ea579c72ffaf8a7c0a5a6813ec264b03bce7c8 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 1 Nov 2021 12:16:43 -0600 Subject: formatting mostly --- install.sh | 66 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 6b76d7a..f8f8b9d 100755 --- a/install.sh +++ b/install.sh @@ -2,35 +2,37 @@ # set -euxo pipefail # -[[ -z "$1" ]] \ - && echo "usage: install.sh " \ - && echo "where is something from the 'profiles' directory" \ - && exit 1 -# -mkdir -p ~/.config/nixpkgs -NIXDIR="$HOME/.config/nixpkgs" -HOMEFILE="$NIXDIR/home.nix" -NIXFILE="$(pwd)/$1" -# -# 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 -# 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. now we can install, and -# pin our own nixpkgs. -# -nix-channel --update -NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH \ - nix-shell . -A install - #nix-shell '' -A install +if [[ -z "$1" ]]; then + echo "usage: install.sh " + echo "where is something from the 'profiles' directory" + exit 1 +else + # + mkdir -p ~/.config/nixpkgs + NIXDIR="$HOME/.config/nixpkgs" + HOMEFILE="$NIXDIR/home.nix" + NIXFILE="$(pwd)/$1" + # + # 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 + # 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. now we can install, and + # pin our own nixpkgs. + # + #nix-channel --update + NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH \ + nix-shell . -A install + #nix-shell '' -A install +fi -- cgit v1.2.3