-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
60 lines (53 loc) · 1.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
{
description = "Nll crate";
nixConfig = {
extra-substituters = [ "https://espresso-systems-private.cachix.org" ];
extra-trusted-public-keys = [
"espresso-systems-private.cachix.org-1:LHYk03zKQCeZ4dvg3NctyCq88e44oBZVug5LpYKjPRI="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, nixpkgs, flake-compat, utils, fenix }:
utils.lib.eachDefaultSystem (system:
let
fenixStable = fenix.packages.${system}.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"llvm-tools-preview"
];
CARGO_TARGET_DIR = "target_dirs/nix_rustc";
pkgs = import nixpkgs {
inherit system;
};
buildDeps = with pkgs;
[
fenixStable
nixpkgs-fmt
fenix.packages.${system}.rust-analyzer
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
pkgs.libiconv
darwin.apple_sdk.frameworks.SystemConfiguration
];
in {
devShell = pkgs.mkShell {
inherit CARGO_TARGET_DIR;
buildInputs = buildDeps;
};
});
}