-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
72 lines (60 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
72
[private]
default: system-info
@just --list
[unix]
lint:
@echo "📝 Linting Nix config..."
@nix --extra-experimental-features 'nix-command flakes' fmt
@echo "✅ Nix config linted!"
[unix]
check: lint flake-update
@echo "🔍 Checking Nix config..."
@NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 NIXPKGS_ALLOW_UNFREE=1 NIXPKGS_ALLOW_BROKEN=1 nix --extra-experimental-features 'nix-command flakes' flake check --impure --all-systems
@echo "✅ Flake check passed!"
[unix]
flake-update:
@echo "🔄 Updating flake..."
@nix --extra-experimental-features 'nix-command flakes' flake update
@echo "✅ Flake updated!"
[unix]
nix-gc:
@echo "🧹 Garbage collecting nix..."
@nix-env --delete-generations 14d
@nix-store --gc
@echo "✅ Garbage collected!"
[confirm]
[private]
build-macos: check
@echo "🔨 Building Nix config for macOS 🍎"
@nix --extra-experimental-features 'nix-command flakes' run nix-darwin -- switch --flake .#Joes-MacBook-Pro
@echo "✅ Built for macOS!"
[macos]
organize-launchpad:
@echo "🔨 Organizing Launchpad..."
@lporg load --config $(pwd)/environments/common/dotconfig/lporg.yaml --yes --no-backup
@echo "✅ Organized Launchpad!"
[macos]
save-launchpad:
@echo "🔨 Organizing Launchpad..."
@lporg save --config $(pwd)/environments/common/dotconfig/lporg.yaml
@echo "✅ Saved Launchpad!"
[macos]
build: system-info
@just build-macos
[confirm]
[private]
build-wsl: check
@echo "🔨 Building Nix config for WSL 🪟"
@sudo nixos-rebuild --flake .#joe-wsl switch
@echo "✅ Built for WSL!"
[confirm]
[private]
build-bastion: check
@echo "🔨 Building Nix config for NixOS on Oracle Cloud 🐧"
@sudo nixos-rebuild --flake .#oracle-cloud-bastion switch
@echo "✅ Built for NixOS on Oracle Cloud!"
[linux]
build: system-info
@just {{ if shell('uname -r') =~ "WSL" { "build-wsl" } else { "build-bastion" } }}
system-info:
@echo "🖥️ This is an {{arch()}} machine on {{os()}}"