-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
default.nix
74 lines (61 loc) · 1.45 KB
/
default.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
lib,
stdenv,
boost182,
gtest,
lit,
llvmPackages,
meson,
ninja,
nix,
pkg-config,
nlohmann_json,
python312,
}:
stdenv.mkDerivation {
pname = "nixd";
version = "nightly";
src = ./.;
mesonBuildType = "release";
nativeBuildInputs = [
meson
ninja
python312
pkg-config
];
nativeCheckInputs = [ lit ];
buildInputs = [
nix
gtest
boost182
llvmPackages.llvm
nlohmann_json
];
env.CXXFLAGS = "-include ${nix.dev}/include/nix/config.h";
doCheck = !stdenv.isDarwin;
checkPhase = ''
runHook preCheck
dirs=(store var var/nix var/log/nix etc home)
for dir in $dirs; do
mkdir -p "$TMPDIR/$dir"
done
export NIX_STORE_DIR=$TMPDIR/store
export NIX_LOCALSTATE_DIR=$TMPDIR/var
export NIX_STATE_DIR=$TMPDIR/var/nix
export NIX_LOG_DIR=$TMPDIR/var/log/nix
export NIX_CONF_DIR=$TMPDIR/etc
export HOME=$TMPDIR/home
# Disable nixd regression tests, because it uses some features provided by
# nix, and does not correctly work in the sandbox
meson test --print-errorlogs unit/libnixf/Basic unit/libnixf/Parse unit/libnixt
runHook postCheck
'';
meta = {
mainProgram = "nixd";
description = "A feature-rich Nix language server interoperating with C++ nix";
homepage = "https://github.com/nix-community/nixd";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ inclyc ];
platforms = lib.platforms.unix;
};
}