Skip to content

Commit

Permalink
Merge pull request #270 from himkt/bye-nix
Browse files Browse the repository at this point in the history
maint(all): back to non-nix
  • Loading branch information
himkt authored Dec 10, 2024
2 parents 878d0cf + 7659a51 commit 687d25c
Show file tree
Hide file tree
Showing 42 changed files with 358 additions and 630 deletions.
65 changes: 52 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,46 @@
RED := $(shell tput setaf 1)
NOCOLOR := $(shell tput sgr0)

.PHONY: all docs \
.PHONY: \
all docs brew \
base cli gui \
cargo git \
nvim tmux uv zsh

all: clean base docs

# =========================

brew:
$(PWD)/brew/bin/setup.sh

brew-base:
brew bundle --verbose --no-lock --file=$(PWD)/brew/config.d/base/Brewfile

brew-optional:
brew bundle --verbose --no-lock --file=$(PWD)/brew/config.d/optional/Brewfile

brew-gui:
brew bundle --verbose --no-lock --file=$(PWD)/brew/config.d/gui/Brewfile

krew-base:
kubectl krew install open-svc oidc-login ns images ctx hns stern neat

# =========================

base: cargo git tmux zsh

cargo: cargo_clean
$(PWD)/cargo/bin/setup.sh

git: git_clean
$(PWD)/git/bin/setup.sh

nix: nix_clean
$(PWD)/nix/bin/setup.sh

nvim: nvim_clean
$(PWD)/nvim/bin/setup.sh

poetry: poetry_clean
$(PWD)/poetry/bin/setup.sh
sheldon: sheldon_clean
$(PWD)/sheldon/bin/setup.sh

tmux: tmux_clean
$(PWD)/tmux/bin/setup.sh
Expand Down Expand Up @@ -47,28 +69,45 @@ git_clean:
rm -rf $(HOME)/.config/git/config
rm -rf $(HOME)/.config/git/ignore

nix_clean:
# TODO(himkt); uninstall nix itself.
rm -rf $(HOME)/.config/nix

nvim_clean:
rm -rf $(HOME)/.vimrc
rm -rf $(HOME)/.vim
rm -rf $(HOME)/.config/nvim

sheldon_clean:
rm -rf $(HOME)/.config/sheldon

tmux_clean:
rm -rf $(HOME)/.tmux.conf

uv_clean:
rm -rf $(HOME)/.local/bin/uv $(HOME)/.local/bin/uvx

wezterm_clean:
rm -rf $(HOME)/.wezterm.lua
rm -rf $(HOME)/.config/wezterm

zsh_clean:
rm -rf $(HOME)/.zshrc

# =========================

nix_apply:
darwin-rebuild switch --flake $(PWD)/nix/config.d
docs:
@echo ""
@echo "### Finish installing dotfiles!"
@echo "Please run $(RED)source $$HOME/.zshrc$(NOCOLOR) on zsh to enable configures."
@echo "- If you want to use nvim with extensions, please run $(RED)make nvim$(NOCOLOR) (which needs pyenv)."
@echo "- If you want to install pyenv using brew, please read the Python section below."
@echo ""
@echo "---"
@echo ""
@echo "### Packages"
@echo "- If you want to use linuxbrew/homebrew, please run $(RED)make brew-cui$(NOCOLOR)."
@echo "- Please run $(RED)make brew$(NOCOLOR) before if you have not installed brew yet"
@echo "- Additionally, $(RED)make brew-optional$(NOCOLOR) installs optional packages"
@echo ""
@echo "---"
@echo ""
@echo "### Python"
@echo "- After $(RED)make brew, make brew-cui, source $$HOME/.zshrc$(NOCOLOR),"
@echo " you can run $(RED)make nvim$(NOCOLOR) to install Python and the nvim library"
@echo ""
26 changes: 26 additions & 0 deletions brew/bin/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

case `uname -s` in
Darwin*)
if [ `uname -m` = "arm64" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
else
sudo mkdir /opt/homebrew-x86_64
sudo chown `whoami`:staff /opt/homebrew-x86_64
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew-x86_64
fi
;;
Linux*)
if [ "$INSTALL_HOMEBREW_ON_HOME" != "" ]; then
HOMEBREW_INSTALL_DIR=$HOME/.linuxbrew
echo "Start custom installation to $HOMEBREW_INSTALL_DIR"
mkdir -p $HOMEBREW_INSTALL_DIR
pushd $HOMEBREW_INSTALL_DIR
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $HOMEBREW_INSTALL_DIR
popd
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
;;
esac

12 changes: 12 additions & 0 deletions brew/config.d/base/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
brew 'atuin'
brew 'coreutils'
brew 'envchain'
brew 'difftastic'
brew 'fzf'
brew 'ghq'
brew 'gh'
brew 'git-lfs'
brew 'jq'
brew 'sheldon'
brew 'tree'
brew 'zoxide'
10 changes: 10 additions & 0 deletions brew/config.d/gui/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cask 'arc'
cask 'font-jetbrains-mono'
cask 'docker'
cask 'notion'
cask 'ngrok/ngrok/ngrok'
cask 'insomnia'
cask 'slack'
cask 'visual-studio-code'
cask 'wezterm'
cask '1password'
19 changes: 19 additions & 0 deletions brew/config.d/optional/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
brew 'bazelisk'
brew 'binutils'
brew 'htop'
brew 'krew'
brew 'kubernetes-cli'
brew 'neovim'
brew 'nodenv'
brew 'the_silver_searcher'
brew 'tmux'

tap 'derailed/k9s'
tap 'himkt/himkt'
tap 'ktr0731/evans'
tap 'ynqa/tap'

brew 'derailed/k9s/k9s'
brew 'himkt/himkt/ac-random-test'
brew 'ktr0731/evans/evans'
brew 'ynqa/tap/jnv'
17 changes: 0 additions & 17 deletions flake.nix

This file was deleted.

9 changes: 9 additions & 0 deletions git/bin/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

mkdir -p $HOME/.config/git

rm -rf $HOME/.config/git/config
rm -rf $HOME/.config/git/ignore

ln -s $HOME/dotfiles/git/config.d/config $HOME/.config/git/config
ln -s $HOME/dotfiles/git/config.d/ignore $HOME/.config/git/ignore
13 changes: 13 additions & 0 deletions git/config.d/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[user]
email = [email protected]
name = himkt

[pull]
rebase = false

[alias]
remove-merged = !remove-merged-branches

[format]
pretty = format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]
date = iso
19 changes: 19 additions & 0 deletions git/config.d/ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# editor
.vim
.vscode

# ruby
.rakeTasks
.rubocop.yml

# python
.venv
*.egg-info
.mypy_cache

# jetbrains
.idea

.DS_Store

.apple-silicon-platform
7 changes: 0 additions & 7 deletions nix/bin/setup.sh

This file was deleted.

27 changes: 0 additions & 27 deletions nix/config.d/darwin/darwin.nix

This file was deleted.

8 changes: 0 additions & 8 deletions nix/config.d/darwin/environment/systemPackages.nix

This file was deleted.

7 changes: 0 additions & 7 deletions nix/config.d/darwin/fonts/packages.nix

This file was deleted.

20 changes: 0 additions & 20 deletions nix/config.d/darwin/homebrew.nix

This file was deleted.

7 changes: 0 additions & 7 deletions nix/config.d/darwin/security/pam.nix

This file was deleted.

8 changes: 0 additions & 8 deletions nix/config.d/darwin/system/defaults/NSGlobalDomain.nix

This file was deleted.

26 changes: 0 additions & 26 deletions nix/config.d/darwin/system/defaults/controlcenter.nix

This file was deleted.

9 changes: 0 additions & 9 deletions nix/config.d/darwin/system/defaults/dock.nix

This file was deleted.

9 changes: 0 additions & 9 deletions nix/config.d/darwin/system/defaults/finder.nix

This file was deleted.

7 changes: 0 additions & 7 deletions nix/config.d/darwin/system/defaults/loginwindow.nix

This file was deleted.

8 changes: 0 additions & 8 deletions nix/config.d/darwin/system/keyboard.nix

This file was deleted.

Loading

0 comments on commit 687d25c

Please sign in to comment.