-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 947 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
ifndef host
$(error "host is not set. Please provide with either: \
make deploy-darwin host=myHost user=myUser _OR_\
make deploy-linux host=myHost user=myUser")
endif
ifndef user
$(error "user is not set. Please provide with either: \
make deploy-darwin host=myHost user=myUser _OR_ \
make deploy-linux host=myHost user=myUser")
endif
deploy-darwin:
nix build .#darwinConfigurations.$(host).system \
--extra-experimental-features 'nix-command flakes'
# Activate system
./result/sw/bin/darwin-rebuild switch --flake .#$(host)
# Build and switch home-manager config
home-manager switch --flake .#$(user)@$(host)
deploy-linux:
nix build .#nixosConfigurations.$(host).config.system.build.toplevel \
--extra-experimental-features 'nix-command flakes'
# Activate system
sudo ./result/sw/bin/nixos-rebuild switch --flake .#$(host)
# Build and switch home-manager config
home-manager switch --flake .#$(user)@$(host)