-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathshell.nix
54 lines (50 loc) · 1.17 KB
/
shell.nix
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
{ mkShell
, qlc
, clippy
, rustfmt
, just
, yarn
, writeText
, runCommand
, makeBinaryWrapper
}:
let
justfile = writeText "qlc-justfile" ''
[private]
default:
@just --list --list-heading $'QLC recipes\n'
# Build the schema for cargo tests
build-test-schema:
@yarn --cwd tests/fixtures/schema_generation install --frozen-lockfile
# Turning tests/fixtures/schema_generation/schema.graphl into a usable tests/fixtures/schema_generation/output/schema.json
@yarn --cwd tests/fixtures/schema_generation run build
# Run tests
test *args:
cargo test {{args}}
# Format source files
format:
cargo fmt --all
nix fmt
# Lint Rust source files
lint:
cargo clippy --all-targets --all-features -- -D warnings
'';
justWithConfig = runCommand
"qlc-wrapped-just"
{ nativeBuildInputs = [ makeBinaryWrapper ]; }
''
makeBinaryWrapper ${just}/bin/just $out/bin/just \
--add-flags '--justfile ${justfile}' \
--add-flags '--working-directory .'
'';
in
mkShell {
name = "qlc-devshell";
inputsFrom = [ qlc ];
packages = [
yarn
clippy
rustfmt
justWithConfig
];
}