-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (23 loc) · 931 Bytes
/
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
.SILENT: switch
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
include ${ROOT_DIR}/me
load:
test -f ${ROOT_DIR}/me || { echo "File ${ROOT_DIR}/me is required to know what machine config to use."; exit 7; }
test $(ME_MACHINE) || { echo "Variable ME_MACHINE is required to know what machine config to use."; exit 7; }
whoami: load
echo "Machine to be configured: ${ME_MACHINE}"
cleanup:
sudo nix-collect-garbage -d
.PHONY: cleanup
switch: whoami
if [ ${ME_MACHINE} = "terra" ]; then \
sudo nixos-rebuild switch --impure --flake .#desktop-amd64; \
elif [ ${ME_MACHINE} = "sys76" ]; then \
sudo nixos-rebuild switch --impure --flake .#system76; \
else \
echo "Unknown 'uname -m' target" ; \
fi
update:
nix flake update
update-vscode-extensions:
deno run --allow-env --allow-run --allow-net --allow-read --allow-write --unstable --no-check ~/.local/bin/nix-vscode-extensions.ts --update