-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
53 lines (46 loc) · 1.64 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
{
description = "Dev shell the project";
inputs = {
naersk.url = "github:nix-community/naersk";
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, naersk, fenix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust = fenix.packages.${system}.complete.toolchain;
naersk' = pkgs.callPackage naersk { };
aarch_64_pkgsCross = import nixpkgs {
inherit system;
crossSystem = { config = "aarch64-unknown-linux-gnu"; };
};
aarch_64_naersk_cross = aarch_64_pkgsCross.callPackage naersk { };
in {
defaultPackage = naersk'.buildPackage {
src = ./.;
nativeBuildInputs = with pkgs; [ protobuf ];
buildInputs = with pkgs; [ gcc cmake glibc stdenv.cc ];
};
packages.aarch64-unknown-linux-gnu = aarch_64_naersk_cross.buildPackage {
src = ./.;
nativeBuildInputs = [ pkgs.protobuf aarch_64_pkgsCross.gcc aarch_64_pkgsCross.cmake aarch_64_pkgsCross.glibc aarch_64_pkgsCross.stdenv.cc ];
buildInputs = with aarch_64_pkgsCross; [ gcc cmake glibc stdenv.cc ];
};
nixpkgs.overlays = [ fenix.overlays.complete ];
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.protobuf
rust
pkgs.lldb_9
pkgs.sccache
pkgs.mold
pkgs.clang
];
};
});
}