diff options
author | William Carroll <wpcarro@gmail.com> | 2018-07-18T23·53-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2018-07-19T16·00-0400 |
commit | a86c2ddece8fde8a42f1e6031b189d1865b9b211 (patch) | |
tree | 77c56fd69f574b697e831fd8c062e7672e342cf2 | |
parent | e8ca641075b0acfab44fd424f08ab6fa6f630495 (diff) |
Prefer stow over hand-rolled solution
After discovering GNU stow on Nix IRC, refactored install and setup scripts to consume it. Code is vastly simplified as a result.
-rw-r--r-- | configs/linux/xinit/.xinitrc (renamed from configs/linux/.xinitrc) | 0 | ||||
-rw-r--r-- | configs/os_x/slate/.slate.js (renamed from configs/os_x/.slate.js) | 0 | ||||
-rwxr-xr-x | configs/setup | 44 | ||||
-rw-r--r-- | configs/shared/ctags/.ctags (renamed from configs/shared/.ctags) | 0 | ||||
-rw-r--r-- | configs/shared/ghci | 13 | ||||
-rw-r--r-- | configs/shared/git/.gitconfig (renamed from configs/shared/.gitconfig) | 0 | ||||
-rw-r--r-- | configs/shared/git/.gitignore (renamed from configs/shared/.gitignore) | 0 | ||||
-rw-r--r-- | configs/shared/haskell/.ghci | 32 | ||||
-rw-r--r-- | configs/shared/zsh/.zshrc (renamed from configs/shared/.zshrc) | 3 | ||||
-rw-r--r-- | install.sh | 6 |
10 files changed, 42 insertions, 56 deletions
diff --git a/configs/linux/.xinitrc b/configs/linux/xinit/.xinitrc index a0e8dea3a363..a0e8dea3a363 100644 --- a/configs/linux/.xinitrc +++ b/configs/linux/xinit/.xinitrc diff --git a/configs/os_x/.slate.js b/configs/os_x/slate/.slate.js index e097d935faff..e097d935faff 100644 --- a/configs/os_x/.slate.js +++ b/configs/os_x/slate/.slate.js diff --git a/configs/setup b/configs/setup index e81b49442f42..7b7a814908a3 100755 --- a/configs/setup +++ b/configs/setup @@ -1,47 +1,11 @@ #!/usr/bin/env bash -dotfiles_path="${HOME}/dotfiles" -configs_dir="${dotfiles_path}/configs" -shared_configs="${configs_dir}/shared" +configs="$HOME/dotfiles/configs" if [[ $(uname) == 'Darwin' ]]; then - os_specific_configs="${configs_dir}/os_x" + (cd "$configs/os_x" && stow --target="$HOME" *) elif [[ $(uname) == 'Linux' ]]; then - os_specific_configs="${configs_dir}/linux" + (cd "$configs/linux" && stow --target="$HOME" *) fi - -function symlink_configs () { - configs_dir=$1 - - for cf in $(find $configs_dir -type f -name ".*"); do - filename=$(grep -o "[^\/]+$" <<<$cf) - echo "$filename: " - - if [ -f "${HOME}/${filename}" ] && [ ! -L "${HOME}/${filename}" ]; then - echo -n "Backing up ${filename}... " && \ - mv "${HOME}/${filename}" "${HOME}/${filename}.bak" && \ - echo "Done." - fi - - if [ -L "${HOME}/${filename}" ]; then - if [ $(readlink "${HOME}/${filename}") = $cf ]; then - echo "Already properly symlinked to ${configs_dir}." - else - echo "Already symlinked but NOT to the proper location. Aborting..." - fi - else - echo -n "Symlinking to ${filename}... " && \ - ln -s $cf "${HOME}/${filename}" && \ - echo "Done." - fi - echo "" - done -} - - -# handle shared configs -symlink_configs $shared_configs - -# handle os-specific configs -symlink_configs $os_specific_configs +(cd "$configs/shared" && stow --target="$HOME" *) diff --git a/configs/shared/.ctags b/configs/shared/ctags/.ctags index c018567f2041..c018567f2041 100644 --- a/configs/shared/.ctags +++ b/configs/shared/ctags/.ctags diff --git a/configs/shared/ghci b/configs/shared/ghci deleted file mode 100644 index 844a8901010f..000000000000 --- a/configs/shared/ghci +++ /dev/null @@ -1,13 +0,0 @@ --- Useful Typeclasses -import Control.Applicative -import Data.Monoid - --- Data Structures -import qualified Data.Map.Internal as Map - --- Lenses -import qualified Control.Lens as Lens -import qualified Control.Lens.Traversal as Lens - --- Friendly prompt -:set prompt "\ESC[34mλ> \ESC[m" diff --git a/configs/shared/.gitconfig b/configs/shared/git/.gitconfig index e6d0e7b9bc47..e6d0e7b9bc47 100644 --- a/configs/shared/.gitconfig +++ b/configs/shared/git/.gitconfig diff --git a/configs/shared/.gitignore b/configs/shared/git/.gitignore index 0d9002511ec2..0d9002511ec2 100644 --- a/configs/shared/.gitignore +++ b/configs/shared/git/.gitignore diff --git a/configs/shared/haskell/.ghci b/configs/shared/haskell/.ghci new file mode 100644 index 000000000000..995a5cec2b1d --- /dev/null +++ b/configs/shared/haskell/.ghci @@ -0,0 +1,32 @@ +-- Useful Typeclasses +import Control.Applicative +import Data.Monoid + +-- Data Structures +import qualified Data.Map.Internal as Map + +-- Lenses +import Control.Lens +import qualified Control.Lens as Lens +import qualified Control.Lens.Traversal as Lens + +-- Friendly prompt +:set prompt "\ESC[34mλ> \ESC[m" + +-- GHCi on Acid +:m - Prelude +:m + GOA +setLambdabotHome "/Users/wpcarro/Haskell/bin" +:def bs lambdabot "botsnack" +:def pl lambdabot "pl" +:def unpl lambdabot "unpl" +:def redo lambdabot "redo" +:def undo lambdabot "undo" +:def index lambdabot "index" +:def docs lambdabot "docs" +:def instances lambdabot "instances" +:def hoogle lambdabot "hoogle" +:def source lambdabot "fptools" +:def where lambdabot "where" +:def version lambdabot "version" +:def src lambdabot "src" diff --git a/configs/shared/.zshrc b/configs/shared/zsh/.zshrc index f18ef365edbf..49452db76eaa 100644 --- a/configs/shared/.zshrc +++ b/configs/shared/zsh/.zshrc @@ -3,6 +3,9 @@ export DOTFILES="${HOME}/dotfiles" export ZSH="${HOME}/.oh-my-zsh" export PATH="${PATH}:${HOME}/.local/bin" +# Put this here temporarily until we have a better place for it. +export FPP_EDITOR='emacsclient -n' + ZSH_THEME=refined plugins=(zsh-autosuggestions git git-extras github) diff --git a/install.sh b/install.sh index ed2b80fcfc57..d8233b3bf185 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash -source "${DOTFILES}/configs/setup" -ln -s "${DOTFILES}/emacs.d" "${HOME}/.emacs.d" +source "$HOME/dotfiles/configs/setup" +ln -s "$DOTFILES/emacs.d" "$HOME/.emacs.d" |