-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
89 lines (82 loc) · 2.47 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
# Tremendous thanks to @oati for her help
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rustVersion = pkgs.rust-bin.stable.latest.default;
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
python-package-list = p: with p; [
pip
pandas
numpy
certifi
colorama
pysocks
requests
requests-futures
stem
torrequest
openpyxl
exrex
matplotlib
];
python = pkgs.python311.withPackages python-package-list;
r6rsRustBuild = rustPlatform.buildRustPackage rec {
pname = "app";
version = "0.0.1";
src = ./.;
cargoBuildFlags = "";
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ (rustVersion.override { extensions = ["rust-src"]; }) ] ++ (with pkgs; [
pkg-config
cargo
gcc
rustfmt
clippy
openssl.dev
git
gh
]) ++ [ python ];
libPath = with pkgs; lib.makeLibraryPath [
udev
alsa-lib
vulkan-loader
libGL
libxkbcommon
gtk3-x11
gtk3
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libxcb
];
# 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.
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
LD_LIBRARY_PATH = libPath;
OPENSSL_LIB_DIR = pkgs.openssl.out + "/lib";
};
in
{
packages.r6rs = r6rsRustBuild;
}
);
}