-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (47 loc) · 1.71 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
{
# testing flake: nix develop --unset PATH
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay/stable";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
rust-overlay.inputs.flake-utils.follows = "flake-utils";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
target = "wasm32-unknown-unknown";
targetUpperSnake = pkgs.lib.toUpper (builtins.replaceStrings [ "-" ] [ "_" ] target);
toolchainOverride = {
extensions = [ "rust-src" ];
targets = [ target ];
};
in
{
devShells.default = pkgs.mkShell {
RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
"CARGO_TARGET_${targetUpperSnake}_LINKER" = "${pkgs.lld_18}/bin/lld";
RUSTFLAGS = nixpkgs.lib.strings.concatStringsSep " " [
# "-C link-arg=-fuse-ld=${pkgs.mold}"
# "-C link-arg=--ld-path=${pkgs.mold}"
# "-Zlinker-features=-lld"
];
nativeBuildInputs = with pkgs; [
# (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override toolchainOverride))
(rust-bin.stable.latest.default.override toolchainOverride)
# (rust-bin.stable."1.73.0".default.override toolchainOverride)
just
git
yarn
wasm-pack
vsce
(pkgs.writeShellScriptBin "ovsx" "${pkgs.bun}/bin/bunx ovsx $@")
];
};
}
);
}