forked from AlexNabokikh/nix-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
72 lines (54 loc) · 1.94 KB
/
justfile
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
60
61
62
63
64
65
66
67
68
69
70
71
# Justfile for Nix Darwin and Home Manager system management
# Determine the hostname dynamically
hostname := `hostname`
# Default recipe: Shows available commands
default:
@just --list
# Switch Nix Darwin configuration dynamically
darwin-switch:
nix run nix-darwin -- switch --flake .#{{hostname}}
# Switch Nix Darwin configuration for macvm-fs
darwin-switch-macvm-fs:
nix run nix-darwin -- switch --flake .#macvm-fs
# Switch Home Manager configuration dynamically
home-switch:
home-manager switch --flake .#fs@{{hostname}}
# Switch Home Manager configuration for macvm-fs
home-switch-macvm-fs:
home-manager switch --flake .#fs@macvm-fs
# Update flake inputs
update:
nix flake update
# Cleanup Nix store and generations
clean:
nix-collect-garbage -d
home-manager expire-generations "-7 days"
# Build Darwin configuration dynamically without switching
darwin-build:
nix run nix-darwin -- build --flake .#{{hostname}}
# Build Darwin configuration for macvm-fs without switching
darwin-build-macvm-fs:
nix run nix-darwin -- build --flake .#macvm-fs
# Build Home Manager configuration dynamically without switching
home-build:
home-manager build --flake .#fs@{{hostname}}
# Build Home Manager configuration for macvm-fs without switching
home-build-macvm-fs:
home-manager build --flake .#fs@macvm-fs
# Show current system and home manager configurations
show-config:
#!/usr/bin/env bash
echo "=== Nix Darwin Configuration ==="
darwin-rebuild --show-trace show-configuration
echo -e "\n=== Home Manager Configuration ==="
home-manager configuration
# Verify flake
verify-flake:
nix flake check
# Open nix repl with current flake
repl:
nix repl .#
# Quick system and home update dynamically (combination of update and switch commands)
quick-update: update darwin-switch home-switch
# Quick system and home update for macvm-fs
quick-update-macvm-fs: update darwin-switch-macvm-fs home-switch-macvm-fs