-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
73 lines (71 loc) · 2.31 KB
/
flake.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
{
description = "Nix Debug Adapter Implementation (DAP)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-release = {
url = "github:NixOS/nix?ref=2.19.2";
};
bear-fix = {
url = "github:emilazy/nixpkgs/fix-bear";
};
};
outputs = inputs@{ self, nixpkgs, utils, fenix, nix-release, bear-fix }:
utils.lib.eachDefaultSystem (system:
let
fenixStable = fenix.packages.${system}.stable.withComponents [ "cargo" "clippy" "rust-src" "rustc" "rustfmt" "llvm-tools-preview" ];
overlaid = final: prev:
{
# rustc = fenixStable;
# cargo = fenixStable;
# rust-src = fenixStable;
nix = nix-release.packages.${system}.nix-clang11Stdenv;
};
pkgs = import nixpkgs {
inherit system;
overlays = [
overlaid
];
};
in {
# use clang 11 because nix's clang is 11
# annoying link errors if we try clang 15
devShell = pkgs.mkShell.override { stdenv = pkgs.clang11Stdenv; } {
shellHook = ''
export CARGO_TARGET_DIR="$(git rev-parse --show-toplevel)/target_dirs/nix_rustc";
'';
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
buildInputs =
with pkgs; [
# rust-src
pkg-config
fenixStable
fenix.packages.${system}.rust-analyzer
just
cargo-expand
# cargo
# rustc
nix
nix.dev
bear-fix.legacyPackages.${system}.bear
# bear
rust-cbindgen # for executable cbindgen
clang-tools_15 # for up to date clangd
clang_11
boost
protobuf
pkg-config
] ++
pkgs.lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
pkgs.libiconv
darwin.apple_sdk.frameworks.SystemConfiguration
];
};
test = builtins.enable-dap;
});
}