Skip to content

Commit 81d19f1

Browse files
committed
new nix draft
Signed-off-by: Ruowen Qin <chinqrw@gmail.com>
1 parent 4dcf424 commit 81d19f1

File tree

3 files changed

+144
-0
lines changed

3 files changed

+144
-0
lines changed

tools/memcached_benchmark/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ debug = false
3838
codegen-units = 1
3939
panic = "abort"
4040
strip = true
41+
lto = "thin"

tools/memcached_benchmark/flake.lock

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
description = "Rust development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
rust-overlay.url = "github:oxalica/rust-overlay";
7+
flake-utils.url = "github:numtide/flake-utils";
8+
};
9+
10+
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
11+
flake-utils.lib.eachDefaultSystem (system:
12+
let
13+
overlays = [ (import rust-overlay) ];
14+
pkgs = import nixpkgs {
15+
inherit system overlays;
16+
};
17+
18+
# 1. Replicate languages.rust
19+
rustToolchain = pkgs.rust-bin.nightly.latest.default.override {
20+
extensions = [
21+
"rust-src"
22+
"rustc"
23+
"clippy"
24+
"rust-analyzer"
25+
"rustfmt"
26+
];
27+
};
28+
in
29+
{
30+
devShells.default = pkgs.mkShell {
31+
buildInputs = with pkgs; [
32+
git
33+
mold
34+
llvmPackages.clangUseLLVM
35+
memcached
36+
rustToolchain
37+
];
38+
39+
shellHook = ''
40+
# enterShell logic
41+
clang --version
42+
rustc --version
43+
'';
44+
};
45+
}
46+
);
47+
}

0 commit comments

Comments
 (0)