diff --git a/Makefile b/Makefile index 5e0d229..690b2a6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ include test.mk .DEFAULT_GOAL := all -.PHONY: git +.PHONY: git zsh -all: system nix devbox terminal #devops neovim ## Install and configure everything (default) +all: system nix zsh devbox terminal #devops neovim ## Install and configure everything (default) help: ## Display help @grep -hE '^[a-zA-Z_0-9%-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' @@ -16,7 +16,7 @@ system-configure: ## Create directories, install fonts, etc. git: ## Configure git @./scripts/git.sh configure -terminal: zsh ohmyzsh git starship-configure bat-configure delta-configure direnv-configure #lsd fzf ripgrep shellcheck lazygit win32yank navi ## Setup the terminal +terminal: ohmyzsh git starship-configure bat-configure delta-configure direnv-configure #lsd fzf ripgrep shellcheck lazygit win32yank navi ## Setup the terminal nix: ## Nix install @./scripts/nix.sh install devbox: devbox-install devbox-configure ## Install and configure devbox diff --git a/scripts/devbox.sh b/scripts/devbox.sh index 6796920..0545579 100755 --- a/scripts/devbox.sh +++ b/scripts/devbox.sh @@ -18,10 +18,16 @@ do_install() { do_configure() { info "[devbox] Configure" info "[devbox][configure] Create dir" - mkdir -p "$HOME/.local/share/devbox/global/default" + DEVBOX_GLOBAL_DIR="$HOME/.local/share/devbox/global/default" + mkdir -p "$DEVBOX_GLOBAL_DIR" info "[devbox][configure] Create symlinks" - ln -fs "$(pwd)/devbox/devbox.json" "$HOME/.local/share/devbox/global/default/devbox.json" + ln -fs "$(pwd)/devbox/devbox.json" "$DEVBOX_GLOBAL_DIR/devbox.json" + # echo "eval '$(devbox global shellenv)'" >> ~/.zshrc + # source ~/.zshrc + # temporarily add the global packages to the current shell (this is already configured in oh-my-zsh) + source <(devbox global shellenv --init-hook) devbox global install + refresh-global } main() { diff --git a/scripts/zsh.sh b/scripts/zsh.sh index 9c32fb8..73664e2 100755 --- a/scripts/zsh.sh +++ b/scripts/zsh.sh @@ -9,6 +9,9 @@ do_configure() { info "[zsh] Install" sudo apt-get install -qq -y zsh info "[zsh] Configure" + info "[zsh][configure] Create empty config if config is missing" + # TODO add check to create empty config only if config is missing + echo "# Empty config created by dotfiles (will be replaced by oh-my-zsh)" >> ~/.zshrc info "[zsh][configure] Set as default shell" chsh -s "$(which zsh)" }