This repository was archived by the owner on Sep 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (67 loc) · 2.76 KB
/
Makefile
File metadata and controls
74 lines (67 loc) · 2.76 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
SHELL = /usr/bin/env
.SHELLFLAGS = bash -c
CYAN_TERMINAL_OUTPUT = \033[1;36m
GREEN_TERMINAL_OUTPUT = \033[1;32m
RED_TERMINAL_OUTPUT = \033[1;31m
CLEAR = \033[0m
install: --config-home --install-home ${HOME}/.ssh/config
.ONESHELL:
--config-home:
@{ \
echo -e "${GREEN_TERMINAL_OUTPUT}--> Building Home...${CLEAR}"
mkdir -p build
cat configs/*.org >build/tangle.org
emacs -Q --batch --eval "(require 'org)" \
--eval "(add-hook 'org-babel-pre-tangle-hook (lambda () (setq coding-system-for-write 'utf-8-unix)))" \
--eval '(org-babel-tangle-file "build/tangle.org")'
shopt -s dotglob
test -d home && cp -pr home/* build/home/ || true
}
.ONESHELL:
--install-home:
@{ \
if command -v guix; then
echo -e "${GREEN_TERMINAL_OUTPUT}--> Deploying Guix Home...${CLEAR}"
if guix time-machine -C channels.scm -- home reconfigure ./build/guix-home-config.scm; then
echo -e "${GREEN_TERMINAL_OUTPUT}--> Finished deploying home with Guix.${CLEAR}"
fi
elif command -v stow; then
echo -e "${CYAN_TERMINAL_OUTPUT}--> Warning: Guix not found, deploying with Stow...${CLEAR}"
echo -e "${GREEN_TERMINAL_OUTPUT}--> Deploying home with Stow...${CLEAR}"
if stow --no-folding --adopt --dir=./build --target ~/ home; then
echo -e "${GREEN_TERMINAL_OUTPUT}--> Finished deploying home with Stow.${CLEAR}"
fi
elif command -v rsync; then
echo -e "${CYAN_TERMINAL_OUTPUT}--> Warning: Guix not found, deploying with Rsync...${CLEAR}"
echo -e "${GREEN_TERMINAL_OUTPUT}--> Deploying home with Rsync...${CLEAR}"
if rsync -avr build/home/ ~/; then
echo -e "${GREEN_TERMINAL_OUTPUT}--> Finished deploying home with Rsync.${CLEAR}"
fi
fi
}
.ONESHELL:
--install-terminfo:
@{ \
echo -e "${GREEN_TERMINAL_OUTPUT}--> Copying emacs-eat terminfo files${CLEAR}"
cp -pr "$$(emacs --batch --eval "(require 'eat)" --eval "(princ eat-term-terminfo-directory)")" "${XDG_DATA_HOME}"/terminfo
}
update-channels:
@{
echo -e "${GREEN_TERMINAL_OUTPUT}--> Updating channels.scm...${CLEAR}"
mkdir -p build
sed -e '/commit/,+1d' channels.scm >build/channels-update.scm
channels="$$(guix time-machine -C build/channels-update.scm -- describe --format=channels)" \
&& echo "$$channels" >channels.scm \
&& guix pull -C channels.scm
}
${HOME}/.ssh/config : ${HOME}/.ssh/config.d/$(wildcard *.conf *.config)
@{ \
echo -e "${GREEN_TERMINAL_OUTPUT}--> Concatenating ~/.ssh/config...${CLEAR}"
echo -e "# Do not edit this file manually!\n# It is automatically generated from the .ssh/config.d folder.\n" >"${HOME}/.ssh/config"
cat ${HOME}/.ssh/config.d/{*.conf,*.config} >>"${HOME}"/.ssh/config 2>/dev/null
chmod 600 "${HOME}"/.ssh/config
echo -e "${GREEN_TERMINAL_OUTPUT}--> Finished concatenating ~/.ssh/config.${CLEAR}"
}
clean:
@echo "Removing build artifacts..."
@rm -rf build