From fa47b22aa64c86dc369fdc0cbb60e90eaeca1e75 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 9 Nov 2018 11:10:58 -0800 Subject: Machine-specific home.nix, install from git repo instead of tarball --- install.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'install.sh') 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 -- cgit v1.2.3