Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
114 lines (96 loc) · 2.98 KB
/
Copy pathflake.nix
File metadata and controls
114 lines (96 loc) · 2.98 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
113
114
{
description = "Development shell for tmc-langs-rust";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
lib = pkgs.lib;
# Pinned here, not in a rust-toolchain.toml, which would also pin rustup for
# non-nix contributors. Keep equal to the workspace Cargo.toml's rust-version
# (floored by `exercise-services-api`) and secret-project-331's toolchain pin.
rustToolchain = pkgs.rust-bin.stable."1.96.0".default;
# Not in nixpkgs; built from the vendored copy. Deps mirror its DESCRIPTION.
tmcRtestrunner = pkgs.rPackages.buildRPackage {
name = "tmcRtestrunner";
src = ./crates/plugins/r/tests/tmcRtestrunner;
propagatedBuildInputs = with pkgs.rPackages; [
testthat
jsonlite
R_utils
];
};
rEnv = pkgs.rWrapper.override {
packages = [
tmcRtestrunner
pkgs.rPackages.testthat
pkgs.rPackages.jsonlite
pkgs.rPackages.R_utils
];
};
# `check` ships check.pc in its sole output; openssl and zlib in .dev.
pkgConfigPath = lib.makeSearchPath "lib/pkgconfig" [
pkgs.openssl.dev
pkgs.zlib.dev
pkgs.check
];
in
{
devShells.default = pkgs.mkShell {
packages = [
# Rust
rustToolchain
# Native build tooling (bindgen needs libclang)
pkgs.pkg-config
pkgs.gcc
pkgs.gnumake
pkgs.cmake
pkgs.openssl
pkgs.zlib
pkgs.zstd
pkgs.libclang
# Java plugin and j4rs's embedded JVM
pkgs.jdk21
pkgs.maven
pkgs.ant
# C# plugin (samples target net8.0)
pkgs.dotnet-sdk_8
# Make plugin (gnumake above)
pkgs.check
pkgs.valgrind
# Python plugin
pkgs.python3
# Node: TS bindings generation
pkgs.nodejs
# R plugin
rEnv
];
# bindgen needs libclang at build time.
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.libclang.lib ];
# Makes j4rs's embedded JVM resolve libzip/libz against the nix loader.
JAVA_HOME = pkgs.jdk21.home;
shellHook = ''
export PATH="${pkgs.jdk21.home}/bin:$PATH"
export PKG_CONFIG_PATH="${pkgConfigPath}''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
'';
};
}
);
}