-
Notifications
You must be signed in to change notification settings - Fork 6
/
devenv.nix
59 lines (52 loc) · 1.61 KB
/
devenv.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
{ pkgs, lib, config, inputs, ... }:
let
pkgs-2305 = import inputs.nixpkgs-2305 { system = pkgs.stdenv.system; };
in
{
# https://devenv.sh/packages/
# on macos frameworks have to be explicitly specified
# otherwise a linker error ocurs on rust packages
packages = [
pkgs.just
pkgs.llvmPackages_16.libllvm
# cargo-llvm-cov is currently marked broken on nixpkgs unstable
pkgs-2305.cargo-llvm-cov
]
++ lib.optionals pkgs.stdenv.isLinux [
pkgs.stdenv.cc.cc.lib
]
++ lib.optionals pkgs.stdenv.isDarwin (
with pkgs.darwin.apple_sdk; [
frameworks.CoreServices
frameworks.CoreFoundation
]
);
# Certain Rust tools won't work without this
# This can also be fixed by using oxalica/rust-overlay and specifying the rust-src extension
# See https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/3?u=samuela. for more details.
#env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
# https://devenv.sh/scripts/
scripts.hello.exec = "echo Welcome to tket2proto devenv!";
enterShell = ''
hello
cargo --version
python --version
uv --version
export LLVM_COV="${pkgs.llvmPackages_16.libllvm}/bin/llvm-cov"
export LLVM_PROFDATA="${pkgs.llvmPackages_16.libllvm}/bin/llvm-profdata"
just setup
source .venv/bin/activate
'';
# https://devenv.sh/languages/
languages.rust = {
enable = true;
channel = "stable";
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ];
};
languages.python = {
enable = true;
uv = {
enable = true;
};
};
}