-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
84 lines (67 loc) · 1.82 KB
/
justfile
File metadata and controls
84 lines (67 loc) · 1.82 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
set shell := ["nu", "-c" ]
default:
@just --list
# update flakes
[group('nix')]
update:
nix flake update
nvim --headless "+Lazy! sync" +qa
# rebuild system
[group('nix')]
[linux]
build:
sudo nixos-rebuild switch --flake .
# rebuild system
[group('nix')]
[macos]
build:
nix build .#darwinConfigurations.mbp.system --extra-experimental-features 'nix-command flakes' --show-trace --verbose
sudo ./result/sw/bin/darwin-rebuild switch --impure --flake .#mbp --show-trace --verbose
alias b := build
# debug build
[group('nix')]
[linux]
debug:
nixos-rebuild switch --flake . --show-trace --verbose
# bootstrap darwin system
[group('nix')]
[macos]
bootstrap:
# install nix
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# setup ssh keys
[group('nix')]
[macos]
ssh_keys:
ssh-add --apple-use-keychain ~/.ssh/id_me
ssh-add --apple-use-keychain ~/.ssh/id_c
ssh-add --apple-use-keychain ~/.ssh/id_g
# show old profiles
[group('nix')]
[linux]
history:
nix profile history --profile /nix/var/nix/profiles/system
# remove old profiles
[group('nix')]
clean:
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
# gc system and user nix store
[group('nix')]
gc:
sudo nix-collect-garbage --delete-older-than 7d
nix-collect-garbage --delete-older-than 7d
# verify nix store Objects
[group('nix')]
verify-store:
nix store verify --all
# Repair Nix Store Objects
[group('nix')]
repair-store *paths:
nix store repair {{paths}}
system-info:
@echo "CPU architecture: {{ arch() }}"
@echo "Operating system type: {{ os_family() }}"
@echo "Operating system: {{ os() }}"
@echo "Home directory: {{ home_directory() }}"