-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
112 lines (101 loc) · 3.24 KB
/
Copy pathflake.nix
File metadata and controls
112 lines (101 loc) · 3.24 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs =
{
nixpkgs,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
tree-sitter-watch = pkgs.writeShellScriptBin "tree-sitter-watch" ''${pkgs.watchexec}/bin/watchexec --clear -e js -e scm -e txt "${pkgs.tree-sitter}/bin/tree-sitter generate && ${pkgs.tree-sitter}/bin/tree-sitter test"'';
owl-ms-language-server = pkgs.writeShellScriptBin "owl-ms-language-server" ''
$__OWL_MS_LSP_SERVER_DEBUG --stdio --offline
'';
# Add this to test offline
# --offline
#
# To profile the language server, I use samply like this
# samply record /home/janek/Git/owl-ms-language-server/target/release/owl-ms-language-server --stdio --offline
# Then samply load profile.json.gz on the result
tarpaulin-report = pkgs.writeShellScriptBin "tarpaulin-report" ''
${pkgs.cargo-tarpaulin}/bin/cargo-tarpaulin --engine llvm --out html && \
xdg-open tarpaulin-report.html
'';
e2e-test = pkgs.writeShellScriptBin "e2e-test" ''
export __OWL_MS_LSP_SERVER_DEBUG = "$(pwd)/target/debug/owl-ms-language-server";
cargo build
pushd editors/code
npm run compile
# This is needed for loading the correct libs for vscode
${pkgs.steam-run-free}/bin/steam-run npm test
'';
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [
(rust-bin.stable.latest.default.override {
extensions = [
"rust-analyzer"
"rust-src"
];
targets = [ "x86_64-unknown-linux-musl" ];
})
# clang
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
# Required for the downloaded VS Code Electron binary used in e2e tests
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
with pkgs;
[
glib
nss
nspr
atk
cups
dbus
libdrm
mesa
pango
cairo
alsa-lib
libxkbcommon
expat
nspr
]
);
__OWL_MS_LSP_SERVER_DEBUG = "/home/janek/Git/owl-ms-language-server/target/debug/owl-ms-language-server";
nativeBuildInputs = with pkgs; [
nodejs_22
tree-sitter
# Scripts of this repository
tree-sitter-watch
samply
owl-ms-language-server
tarpaulin-report
e2e-test
# for e2e and client
typescript-language-server
];
};
}
);
}