-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (56 loc) · 2.29 KB
/
Copy pathMakefile
File metadata and controls
79 lines (56 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.PHONY: ~/.dotfiles
DOTFILES := $(shell pwd)
DARWIN := $(shell uname | grep Darwin)
install: zshrc gitconfig ~/.config/nvim ~/.wezterm.lua ~/.docker/config.json
~/.oh-my-zsh:
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
~/.dotfiles:
echo "export DOTFILES=$(DOTFILES)" > ~/.dotfiles
zshrc: ~/.oh-my-zsh ~/.dotfiles
grep "\.dotfiles" ~/.zshrc || echo ". $(HOME)/.dotfiles" > ~/.zshrc
grep "$(DOTFILES)/zsh/rc" ~/.zshrc || echo "source \$$DOTFILES/zsh/rc" >> ~/.zshrc
[ $(USER) = key ] && grep "zsh/keyrc" ~/.zshrc || echo "source \$$DOTFILES/zsh/keyrc" >> ~/.zshrc
gitconfig: ~/.gitignore
grep include ~/.gitconfig || echo "[include]\n\tpath = $(DOTFILES)/git/config" >> ~/.gitconfig
~/.gitignore:
cp $(DOTFILES)/git/ignore ~/.gitignore
~/.config/nvim:
mkdir -p ~/.config
ln -s $(DOTFILES)/lazyvim ~/.config/nvim
~/.docker/config.json:
mkdir -p ~/.docker
cp $(DOTFILES)/docker/config.json ~/.docker/config.json
docker-compose:
grep "docker-compose" ~/.zshrc || echo 'source \$$DOTFILES/zsh/docker-compose' >> ~/.zshrc
~/.wezterm.lua: sleepwatcher-wezterm
ifneq ($(DARWIN),)
sed s:__dotfiles__:$(DOTFILES): wezterm.lua > ~/.wezterm.lua
endif
sleepwatcher-wezterm:
ifneq ($(DARWIN),)
git clone https://github.com/kosmatov/sleepwatcher-wezterm
endif
clean:
rm ~/.dotfiles ~/.zshrc ~/.gitconfig ~/.gitignore ~/.config/nvim ~/.wezterm.lua
cargo:
curl https://sh.rustup.rs -sSf | sh
install-node:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.zshrc
install-tree-sitter:
cargo install --locked tree-sitter-cli
git-hooks:
cp $(DOTFILES)/git/hooks/* .git/hooks/
build-node-tools:
@docker image ls | grep -q dotfiles-node-tools || docker compose -f $(DOTFILES)/docker-compose.yml build node-tools
node-container: build-node-tools
$(eval export NODE_CONTAINER ?= $(shell docker container ls --filter "name=node-tools" --format "{{.Names}}"))
$(if $(NODE_CONTAINER),,$(eval export NODE_CONTAINER := $(shell docker compose -f $(DOTFILES)/docker-compose.yml up -d node-tools 2>&1 | grep Started | cut -d\ -f3)))
codex: node-container
docker exec -it $(NODE_CONTAINER) $(MAKECMDGOALS)
copilot: node-container
docker exec -it $(NODE_CONTAINER) copilot
node: node-container
docker exec -it $(NODE_CONTAINER) node
%:
echo done