-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (45 loc) · 1.71 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
.PHONY: install_nix uninstall_nix build build-all x86_64-linux aarch64-linux aarch64-darwin eval-android
UNAME := $(shell uname)
NIX_PROFILE := /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
NIX := nom
OS := $(shell uname -s)
ARCH := $(shell uname -m)
JOBS_X86_64-LINUX :=
JOBS_AARCH64-LINUX :=
JOBS_AARCH64-DARWIN :=
ifeq ($(OS),Linux)
JOBS_AARCH64-DARWIN := -j0
ifeq ($(ARCH),x86_64)
SYSTEM := x86_64-linux
JOBS_AARCH64-LINUX := -j0
else ifeq ($(ARCH),aarch64)
SYSTEM := aarch64-linux
JOBS_X86_64-LINUX := -j0
endif
else ifeq ($(OS),Darwin)
SYSTEM := aarch64-darwin
JOBS_X86_64-LINUX := -j0
JOBS_AARCH64-LINUX := -j0
endif
build: $(SYSTEM)
build-all: x86_64-linux aarch64-linux aarch64-darwin
x86_64-linux:
$(NIX) build --impure --no-link --show-trace --system x86_64-linux $(JOBS_X86_64-LINUX) \
.#nixosConfigurations.arusha.config.system.build.toplevel \
.#nixosConfigurations.kilimanjaro.config.system.build.toplevel \
.#nixosConfigurations.manyara.config.system.build.toplevel \
aarch64-linux: eval-android
$(NIX) build --impure --no-link --show-trace --system aarch64-linux $(JOBS_AARCH64-LINUX) \
.#nixosConfigurations.serengeti.config.system.build.toplevel \
aarch64-darwin:
$(NIX) build --no-link --show-trace --system aarch64-darwin $(JOBS_AARCH64-DARWIN) \
.#darwinConfigurations.katavi.system \
.#darwinConfigurations.mikumi.system \
.#darwinConfigurations.work.system \
eval-android:
nix eval .#nixOnDroidConfigurations.default.config.environment.packages | grep -v "error" >/dev/null
$(NIX_PROFILE):
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
install_nix: $(NIX_PROFILE)
uninstall_nix:
/nix/nix-installer uninstall