-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
86 lines (63 loc) · 1.51 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# justfile
# cheatsheet: https://cheatography.com/linux-china/cheat-sheets/justfile/
# ===== Settings ===== #
# set options
set positional-arguments := true
set dotenv-load := true
# assign default value to vars
profile := "$PROFILE"
cachix-target := "nixospilots"
# default recipe to display help information
default:
@just --list
# ===== Nix ===== #
# update all flake inputs
up:
@nix flake update
# update a particular flake input
upp input:
@nix flake lock --update-input {{ input }}
# show flake outputs
show:
@nix flake show
# eval and build packages
eval:
@nix run .#nix-fast-build
# check flake
check:
@nix flake check
# build nix pkg
build pkg:
@nom build .#{{ pkg }} --print-out-paths
build-push pkg:
@nom build .#{{ pkg }} --print-out-paths | cachix push -c 16 {{ cachix-target }}
# run nix pkg
run pkg:
@nix run .#{{ pkg }}
# view flake.lock
view:
@nix-melt
# nix-prefetch-url
prefetch-url url:
@nix-prefetch-url --type sha256 '{{ url }}' | xargs nix hash to-sri --type sha256
# nix-prefetch-git
prefetch-git repo rev:
@nix-prefetch-git --url '[email protected]:{{ repo }}' --rev '{{ rev }}' --fetch-submodules
# activate nix-repl
repl:
@nix repl -f flake:nixpkgs
# apply fix from linters
lint:
@statix fix .
@deadnix --edit .
# ===== Misc ===== #
# count total number of nix-related files
count:
@rg '' --glob "!.git" --glob "!home-estate" --glob "!secrets" --files-with-matches | wc -l
# ===== Git ===== #
# stage all files
add:
@git add .
# git pull
pull:
@git pull --rebase