This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (50 loc) · 1.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
HOSTNAME := $(shell hostname -s)
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Linux)
# Temporary, work around issue with nixos-unstable
TOOL := sudo nixos-rebuild
endif
ifeq ($(UNAME_S),Darwin)
TOOL := darwin-rebuild
endif
# Using the "replace" mode with tpwrules/nixos-apple-silicon doesn't work
# in "pure" mode. The "overlay" option works as well, but rebuilds the world.
ARGS := --impure -v
all:
@echo "Cowardly refusing to run. Try again with 'switch' or 'test'"
install: switch
build:
$(TOOL) build --flake ./#$(HOSTNAME) $(ARGS)
nvd diff /run/current-system result
switch:
$(TOOL) switch --flake ./#$(HOSTNAME) $(ARGS) --show-trace
boot:
$(TOOL) boot --flake ./#$(HOSTNAME) $(ARGS) --show-trace
testdwl:
$(TOOL) switch --flake ./#$(HOSTNAME) $(ARGS) --override-input dwl-minego-customized ../dwl/
switch-debug: check
$(TOOL) switch --flake ./#$(HOSTNAME) --option eval-cache false --show-trace $(ARGS)
switch-offline:
$(TOOL) switch --flake ./#$(HOSTNAME) --option substitute false $(ARGS)
# Build an image for the phone
marvin-image:
nix build ./#marvin-image $(ARGS)
# Build an image for the steam deck
wonko-installer:
nix build .#nixosConfigurations.wonko.config.formats.install-iso $(ARGS)
wonko-image:
nix build .#nixosConfigurations.wonko.config.formats.raw-efi $(ARGS)
update:
@nix flake update
$(TOOL) switch --flake ./#$(HOSTNAME) --upgrade $(ARGS)
check:
@nix flake check --show-trace $(ARGS)
test: check
$(TOOL) dry-build --flake ./#$(HOSTNAME)
rollback:
$(TOOL) switch --flake ./#$(HOSTNAME) --rollback
gateway-vm:
$(TOOL) build-vm --flake ./#gateway-vm
repl:
nixos-repl