-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
66 lines (57 loc) · 1.65 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
{
description = "kindelia-node";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
naersk.url = "github:nix-community/naersk";
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
python3 = pkgs.python3;
rust_toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rust_src = pkgs.rust.packages.stable.rustPlatform.rustcSrc;
nativeBuildInputs = [
pkgs.git
# Build toolchain
pkgs.pkg-config
pkgs.clang
rust_toolchain
# Python
python3
];
dev_packages = [
pkgs.gnumake
# GitHub Actions runner
pkgs.act
# Build tools
pkgs.maturin
# Python
(pkgs.pipenv.override { inherit python3; })
];
naersk' = pkgs.callPackage naersk {
cargo = rust_toolchain;
rustc = rust_toolchain;
};
in
{
devShells.default = pkgs.stdenvNoCC.mkDerivation {
name = "shell";
inherit nativeBuildInputs;
buildInputs = dev_packages;
shellHook = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${python3}/lib
'';
};
packages.default = naersk'.buildPackage {
inherit nativeBuildInputs;
src = ./.;
};
}
);
}