-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·41 lines (33 loc) · 1.08 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
################################################
# Supported commands:
# home-manager build --flake .#zonni@corn
# home-manager switch --flake .#zonni@corn
#
# sudo nixos-rebuild switch --flake .#corn
# nix flake update
################################################
FLAKE := .
USERNAME := zonni
HOSTNAME := corn
.PHONY: all home system update
all: home system
update:
@echo "Updating flake inputs..."
nix flake update
clean:
@echo "Cleaning old generations..."
nix-collect-garbage --delete-old
home:
@echo "Switching home-manager configuration..."
home-manager build --flake $(FLAKE)#$(USERNAME)@$(HOSTNAME)
home-manager switch --flake $(FLAKE)#$(USERNAME)@$(HOSTNAME)
system:
@echo "Switching NixOS configuration..."
sudo nixos-rebuild switch --flake $(FLAKE)#$(HOSTNAME)
help:
@echo "Available targets:"
@echo " all - Run both home and system targets (default)"
@echo " update - Update flake inputs"
@echo " home - Rebuild and switch home-manager configuration"
@echo " system - Rebuild and switch NixOS configuration"
@echo " help - Show this help message"