-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (75 loc) · 2.63 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
92
93
94
95
96
97
98
99
100
101
HOSTNAME = $(shell hostname)
NIX_FILES = $(shell find . -name '*.nix' -type f)
CURR_THEME = $(shell cat ~/.system-theme)
define n
endef
ifndef HOSTNAME
$(error Hostname unknown)
endif
ifeq (, $(shell which nom))
$(error "$n$nnom not in path. run nix-shell -p nix-output-monitor on first run")
endif
## nom currently broken, covers password prompt.
NOM := nom
switch:
# make clear-sddm-cache
make clear-mimeapps
make clear-gpu-cache
make clear-gtkrc
# nixos-rebuild --log-format internal-json -v --use-remote-sudo switch --flake .#${HOSTNAME} -L |& ${NOM} --json
nixos-rebuild --use-remote-sudo switch --flake .#${HOSTNAME} -L
make update-gnupg-perms
# Building defaults to dark, so switch back if it was light before
NEW_THEME=$$(cat ~/.system-theme) ;\
if [ "$(CURR_THEME)" != "$$NEW_THEME" ]; then \
systemctl --user restart toggle-theme ;\
fi
remote-install:
./nixos-anywhere/install.sh
show-trace:
make clear-sddm-cache
make clear-mimeapps
# nixos-rebuild --log-format internal-json -v --use-remote-sudo switch --show-trace --flake .#${HOSTNAME} -L |& ${NOM} --json
nixos-rebuild --use-remote-sudo switch --show-trace --flake .#${HOSTNAME} -L
make update-gnupg-perms
offline:
# nixos-rebuild --log-format internal-json -v --use-remote-sudo switch --offline --option binary-caches "" --flake .#${HOSTNAME} -L |& ${NOM} --json
nixos-rebuild -v --use-remote-sudo switch --offline --option binary-caches "" --flake .#${HOSTNAME} -L
clear-gpu-cache:
mkdir -p ~/.config
find ~/.config/. -type d -name GPUCache -exec rm -rf {} +
get-new-packages:
./build/get-new-packages
gc:
nix-store --gc
nix-env --delete-generations old
boot:
nixos-rebuild --use-remote-sudo boot --flake .#${HOSTNAME} -L
test:
nixos-rebuild --use-remote-sudo test --flake .#${HOSTNAME} -L
update:
nix flake update
update-local:
nix flake lock --update-input remarkable --update-input dcc
update-nflx:
nix flake lock --update-input nflx --update-input nflx-vpn --update-input openconnect-pulse-launcher
update-secrets:
nix flake lock --update-input secrets
upgrade:
make update && make switch
clear-sddm-cache:
sudo ./build/clear-sddm-cache
clear-mimeapps:
[ -L "${HOME}/.config/mimeapps.list" ] || rm -f ${HOME}/.config/mimeapps.list
clear-gtkrc:
# Plasma6 overwrites this, messing up the dark theme
rm -f ${HOME}/.gtkrc-2.0
update-gnupg-perms:
mkdir -p ${HOME}/.gnupg
chmod 700 ${HOME}/.gnupg
update-nixpkgs:
git submodule init
git submodule update --remote nixpkgs
cd nixpkgs; git config remote.upstream.url >&- || git remote add upstream https://github.com/NixOS/nixpkgs.git
cd nixpkgs; git fetch upstream
cd nixpkgs; git pull --rebase upstream master