-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
31 lines (31 loc) · 941 Bytes
/
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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
crane,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.lib.${system};
# Mac gcc and clang don't include iconv by default, needed for building Rust bits
iconv = with pkgs; (lib.optional stdenv.isDarwin libiconv);
in {
packages.default = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
buildInputs = iconv;
};
devShell = pkgs.mkShell {
packages = with pkgs;
[cargo clippy gdb rust-analyzer rustc rustfmt]
++ (lib.optional (stdenv.isLinux && stdenv.isx86_64) rr)
++ iconv;
};
});
}