-
Notifications
You must be signed in to change notification settings - Fork 13
/
shell.nix
47 lines (39 loc) · 956 Bytes
/
shell.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
let
nixpkgs-mozilla = (import <nixpkgs> {}).fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
# This revision is dated 2020-02-19.
rev = "e912ed483e980dfb4666ae0ed17845c4220e5e7c";
sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
};
rust-overlay = "${nixpkgs-mozilla}/rust-overlay.nix";
in
with import <nixpkgs> {
overlays = [
(import rust-overlay)
];
};
let
GitLab-CI-container-image-id = (lib.importJSON ./RUST_VERSION.yaml).image;
Rust-version-str = lib.removePrefix "rust:" GitLab-CI-container-image-id;
in
stdenv.mkDerivation rec {
name = "irc-bot.rs";
nativeBuildInputs = [
(rustChannelOf {
channel = Rust-version-str;
}).rust
clang
git
pkgconfig
];
buildInputs = [
openssl
];
lib_path = lib.makeLibraryPath buildInputs;
postFixup = ''
for f in target/*/"$name"; do
patchelf --set-rpath "$lib_path" "$f"
done
'';
}