-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
48 lines (35 loc) · 1.08 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
# https://github.com/ryan4yin/nix-config/blob/main/Justfile
# use nushell for shell commands
set shell := ["nu", "-c"]
hostname := `cat /etc/hostname`
# show available recipes.
list:
@just --list
rebuild mode='switch' *args='':
sudo nixos-rebuild {{mode}} --flake .#{{hostname}} {{args}}
rebuild-nom mode='switch' *args='--show-trace --verbose':
sudo nom build .#nixosConfigurations.{{hostname}}.config.system.build.toplevel {{args}}
just rebuild {{mode}} {{args}}
up:
nix flake update
# Update specific input
# Usage: just upp nixpkgs
upp input:
nix flake lock --update-input {{input}}
history:
nix profile history --profile /nix/var/nix/profiles/system
repl:
nix repl -f flake:nixpkgs
clean:
# remove all generations older than 7 days
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
gc:
# garbage collect all unused nix store entries
sudo nix store gc --debug
sudo nix-collect-garbage --delete-old
gitgc:
git reflog expire --expire-unreachable=now --all
git gc --prune=now
fmt:
# format the nix files in this repo
nix fmt