-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
50 lines (41 loc) · 1.27 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
set positional-arguments
set shell := ["bash", "-cue"]
root_dir := `git rev-parse --show-toplevel`
flake_dir := root_dir / "tools/nix"
output_dir := root_dir / ".output"
build_dir := output_dir / "build"
# Default target if you do not specify a target.
default:
just --list
# Enter the default Nix development shell and execute the command `"$@`.
develop *args:
just nix-develop "default" "$@"
# Format the project.
format *args:
"{{root_dir}}/tools/scripts/setup-config-files.sh"
nix run --accept-flake-config {{flake_dir}}#treefmt -- "$@"
# Setup the project.
setup *args:
cd "{{root_dir}}" && ./tools/scripts/setup.sh
# Enter the Nix `devShell` with name `$1` and execute the command `${@:2}` (default command is '$SHELL')
[private]
nix-develop *args:
#!/usr/bin/env bash
set -eu
cd "{{root_dir}}"
shell="$1"; shift 1;
args=("$@") && [ "${#args[@]}" != 0 ] || args="$SHELL"
nix develop --no-pure-eval --accept-flake-config \
"{{flake_dir}}#$shell" --command "${args[@]}"
# Lint the project.
lint *args:
echo "TODO: Not implemented"
# Build the module.
build *args:
echo "TODO: Not implemented"
# Test the project.
test *args:
echo "TODO: Not implemented"
# Run an executable.
run *args:
echo "TODO: Not implemented"