install: absorb brew folder, simplify README

This commit is contained in:
Charles Gould 2020-06-15 20:01:15 -05:00
parent 124436ff55
commit 471c96fea2
8 changed files with 31 additions and 37 deletions

View File

@ -4,29 +4,25 @@ Developer config files.
| Tool | Description |
| -------- | ----------- |
| Homebrew | Package management |
| Nix | Package management (experimental) |
| Homebrew | Package management (Mac) |
| Nix | Package management (Linux) |
| Fish | Shell |
| Git | Version control |
| Neovim | Editor |
MacOS is my primary work environment, hence Homebrew. This setup can be deployed on Linux too. I am aware of criticisms with Homebrew on Linux, but it fits my needs. Nix is being considered as an alternative.
### Usage
Run the interactive installer for Mac/Linux: `./install.sh`
If you decline every prompt, it looks like this:
Keep pressing `Enter` to accept every prompt in order.
```
> ./install.sh
Install Homebrew? [Y/n] n
Install Homebrew packages? [Y/n] n
Install Nix? [Y/n] n
Install Nix packages? [Y/n] n
Set login shell? [Y/n] n
Create symlinks? [Y/n] n
Install vim plugins? [Y/n] n
Install package mananger? [Y/n]
Install packages? [Y/n]
Set login shell? [Y/n]
Create symlinks? [Y/n]
Install vim plugins? [Y/n]
```
These steps _should_ be executed in order. You can safely rerun a step if needed; it tries to be idempotent. Backups are created if you have existing configs that would be overwritten. Definitely do not create symlinks until you have installed the [required](brew/Brewfile) packages (the config files depend on them).
Backups are created for existing files that get replaced.

1
brew/.gitignore vendored
View File

@ -1 +0,0 @@
Brewfile.lock.json

View File

@ -1,11 +0,0 @@
tap "homebrew/bundle"
tap "homebrew/core"
brew "bat"
brew "diff-so-fancy"
brew "fd"
brew "fish"
brew "fzf"
brew "neovim"
brew "ripgrep"
brew "tree"

View File

@ -15,6 +15,7 @@ fzy
gawk
gcc
git
git-filter-repo
gitup
go
gradle

View File

@ -35,9 +35,9 @@ end
set --local script_dir (dirname (status -f))
if contains -- '--casks' $argv
_install_extra_casks (string join '/' -- $script_dir 'casks.txt')
_install_extra_casks (string join '/' -- $script_dir 'homebrew-casks.txt')
else
_install_extra_brews (string join '/' -- $script_dir 'brews.txt')
_install_extra_brews (string join '/' -- $script_dir 'homebrew-formulas.txt')
end
functions --erase _install_extra_brews

View File

@ -5,9 +5,17 @@ echo "***** INSTALL HOMEBREW PACKAGES *****"
DOTFILES=$(cd "$(dirname "$0")/.." && pwd)
# Install required tools
brew bundle install --file="$DOTFILES/brew/Brewfile"
brew install \
bat \
diff-so-fancy \
fd \
fish \
fzf \
neovim \
ripgrep \
tree
# Install optional tools (prompted by fzf)
"$DOTFILES/brew/install-extra.fish"
"$DOTFILES/install/install-brew-extra.fish"
echo

View File

@ -5,14 +5,15 @@ echo "***** INSTALL NIX PACKAGES *****"
NIX_ENV="$HOME/.nix-profile/bin/nix-env"
if [ -x "$NIX_ENV" ]; then
"$NIX_ENV" -iA nixpkgs.bat
"$NIX_ENV" -iA nixpkgs.fd
"$NIX_ENV" -iA nixpkgs.fish
"$NIX_ENV" -iA nixpkgs.fzf
"$NIX_ENV" -iA nixpkgs.neovim
"$NIX_ENV" -iA nixpkgs.ripgrep
"$NIX_ENV" -iA nixpkgs.tree
"$NIX_ENV" -iA nixpkgs.gitAndTools.diff-so-fancy
"$NIX_ENV" -iA \
nixpkgs.bat \
nixpkgs.gitAndTools.diff-so-fancy \
nixpkgs.fd \
nixpkgs.fish \
nixpkgs.fzf \
nixpkgs.neovim \
nixpkgs.ripgrep \
nixpkgs.tree
else
echo "Cannot install Nix packages! $NIX_ENV is not executable."
fi