-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (27 loc) · 877 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
SHELL = bash
SECRET_FILES := $(shell find secrets -type f)
.PHONY: build-iso/%
build-iso/%:
nix build .#nixosConfigurations.$().config.system.build.isoImage
PHONY: _git-add-secret-files
_git-add-secret-files:
@for f in $(SECRET_FILES); do \
git add -f $${f}; \
done
.PHONY: _git-rm-secret-files
_git-rm-secret-files:
@for f in $(SECRET_FILES); do \
git rm --cached $${f}; \
done
.PHONY: switch/%
switch/%: _git-add-secret-files
-nixos-rebuild switch --flake .#$* --show-trace
$(MAKE) SECRET_FILES="$(SECRET_FILES)" _git-rm-secret-files
.PHONY: build/%
build/%: _git-add-secret-files
-nixos-rebuild build --flake .#$* --show-trace
$(MAKE) SECRET_FILES="$(SECRET_FILES)" _git-rm-secret-files
.PHONY: dry-build/%
dry-build/%: _git-add-secret-files
-nixos-rebuild dry-build --flake .#$* --show-trace
$(MAKE) SECRET_FILES="$(SECRET_FILES)" _git-rm-secret-files