-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
91 lines (67 loc) · 2.53 KB
/
Makefile
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
80
81
82
83
84
85
86
87
88
89
90
91
# General.
all: update system-reconfigure home-reconfigure
.PHONY: all
# Updating.
update:
@echo "-------------"
@echo "Updating Guix"
@guix pull --channels=${DOTFILES}/guix/channels-list.scm -c `nproc` -M `nproc` || guix pull --channels=${DOTFILES}/guix/channels-list.scm --url="https://codeberg.org/guix/guix-mirror" -c `nproc` -M `nproc`
@guix describe --format=channels > ${DOTFILES}/guix/channels.scm
@cd ${DOTFILES} && git add guix/channels.scm && git commit -m "chore(channels.scm): update channels"
@guix pull --news
@echo "-------------"
@echo "Updating Nix"
@nix flake \update ${DOTFILES}/nix/home/ --commit-lock-file --commit-lockfile-summary "chore(flake.lock): update flake"
@echo "-------------"
.PHONY: update
# Cleaning.
gc:
@echo "-----------------------"
@echo "Collecting Guix Garbage"
@guix gc
@echo "-----------------------"
@echo "Collecting Nix Garbage"
@nix-collect-garbage
@echo "-----------------------"
.PHONY: gc
nuke:
@echo "-----------------"
@echo "Nuking Guix Store"
@guix gc -d
@echo "-----------------"
@echo "Nuking Nix Store"
@nix-collect-garbage -d
@echo "-----------------"
# REPL.
ares:
guix shell guile-next guile-ares-rs -- guile -L ${DOTFILES}/guix/modules -c "(begin (use-modules (guix gexp)) ((@ (ares server) run-nrepl-server)))"
.PHONY: ares
# System.
system-reconfigure:
@echo "--------------------"
@echo "Reconfiguring System"
@sudo guix system reconfigure -L ${DOTFILES}/guix/modules ${DOTFILES}/guix/modules/system/`hostname`.scm --fallback -c `nproc` -M `nproc`
@echo "--------------------"
.PHONY: system-reconfigure
system-edit:
@${EDITOR} "${DOTFILES}/guix/modules/system/`hostname`.scm"
.PHONY: system-edit
# Home.
home-reconfigure:
@echo "-----------------------"
@echo "Reconfiguring Guix Home"
@guix home reconfigure -L ${DOTFILES}/guix/modules ${DOTFILES}/guix/modules/home/`hostname`.scm --fallback -c `nproc` -M `nproc`
@echo "-----------------------"
@echo "Reconfiguring Nix Home"
@home-manager switch --no-write-lock-file --cores `nproc` --max-jobs `nproc`
# Reload Hyprland environment.
@if [ ${XDG_CURRENT_DESKTOP} = Hyprland ]; then hyprctl reload; fi
@echo "-----------------------"
.PHONY: home-reconfigure
home-edit:
@${EDITOR} ${DOTFILES}/guix/modules/home/`hostname`.scm
.PHONY: home-edit
reload:
@guix home reconfigure -L ${DOTFILES}/guix/modules ${DOTFILES}/guix/modules/home/`hostname`.scm --fallback -c `nproc` -M `nproc` --no-substitutes
@home-manager switch --no-write-lock-file --cores `nproc` --max-jobs `nproc` --no-substitute
.PHONY: reload