-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (24 loc) · 786 Bytes
/
Makefile
File metadata and controls
32 lines (24 loc) · 786 Bytes
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
.PHONY: all format rebuild update regenerate-keys upgrade
HOSTNAME := $(shell hostname)
# Detect system type (Linux or Darwin)
SYS_TYPE := $(shell uname -s)
all:
@echo "no command supplied (all/format/rebuild/update/regenerate-keys/upgrade)"
rekey:
gpg --recv-keys 644EFF248A9CA2D269C30A7A6AA809E3B3CCCA64
nix-shell -p sops --run "sops updatekeys secrets/*.yaml"
format:
nix-shell -p alejandra --run 'alejandra *'
nix-shell -p stylua --run 'stylua -g "*.lua" -- .'
rebuild:
ifeq ($(SYS_TYPE),Linux)
@echo "Rebuilding NixOS configuration..."
sudo nixos-rebuild switch --flake .#$(HOSTNAME)
endif
ifeq ($(SYS_TYPE),Darwin)
@echo "Rebuilding Darwin configuration..."
sudo darwin-rebuild switch --flake .#$(HOSTNAME)
endif
update:
nix flake update
upgrade: update rebuild