-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (40 loc) · 1.41 KB
/
Makefile
File metadata and controls
45 lines (40 loc) · 1.41 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
# Allow passing args instead of evaluating them as more goals.
# %:: in the end silences warnings of no matching goal.
cmd := $(firstword $(MAKECMDGOALS))
args := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))# base modules
.PHONY: install
install:
stow atuin ghostty git nvim tmux zsh -t ~
# Hyprland: add subdir to make command (e.g. make hyprland mbp13)
.PHONY: hyprland
hyprland:
@cd hyprland && stow $(args) -t ~
# Nix:
# Can not use stow because nix does not like symlinks
#
# If not empty: copy from the target to adopt changes in the repo.
# It is safe: source is in version control.
#
# If empty: we can safely copy everything
#
# Optionally if "force" arg is passed, we overwrite everthing on the target regardless.
.PHONY: nixos
nixos:
@if [ "$(shell ls -A "/etc/nixos")" ] && [ ! "$(args)" = "force" ]; then \
echo "Target not empty: copying from target"; \
rsync -a /etc/nixos/ nix/nixos --exclude hardware-configuration.nix; \
else \
echo "Target empty or force enabled: copying to target"; \
sudo rsync -a nix/nixos/ /etc/nixos --exclude hardware-configuration.nix; \
fi
.PHONY: nixdarwin
nixdarwin:
@if [ "$(shell ls -A "/etc/nix-darwin")" ] && [ ! "$(args)" = "force" ]; then \
echo "Target not empty: copying from target"; \
rsync -a /etc/nix-darwin/ nix/darwin; \
else \
echo "Target empty or force enabled: copying to target"; \
rsync -a nix/darwin/ /etc/nix-darwin; \
fi
%::
@true