diff options
author | Ben Sima <ben@bsima.me> | 2018-11-09 11:10:58 -0800 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-11-09 11:10:58 -0800 |
commit | fa47b22aa64c86dc369fdc0cbb60e90eaeca1e75 (patch) | |
tree | 9e92974e58e50425a9cac3eb8ca9693ced9934a6 /install.sh | |
parent | 55e5afc345b4376778979807f2c8d4992ebb437e (diff) |
Machine-specific home.nix, install from git repo instead of tarball
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 |