-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
51 lines (48 loc) · 1.58 KB
/
flake.nix
File metadata and controls
51 lines (48 loc) · 1.58 KB
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
{
description = "Development environment for natlint";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};
solcBuildsListJson = let
solcBinBaseUrl = "https://raw.githubusercontent.com/argotorg/solc-bin/26fc3fd";
listJsons = {
"x86_64-linux" = pkgs.fetchurl {
url = "${solcBinBaseUrl}/linux-amd64/list.json";
hash = "sha256-FGcYJmjrX5r6tR+5Y7PkFLDmi+aH7wqd5tUVx8EuESk=";
};
"aarch64-darwin" = pkgs.fetchurl {
url = "${solcBinBaseUrl}/macosx-amd64/list.json";
hash = "sha256-DV9CcC/7GT8yb2ozJ55nM2JUtjSZzeujlHRxgedjHog=";
};
};
in listJsons.${system} or null;
in
{
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "natlint";
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
env = pkgs.lib.optionalAttrs (solcBuildsListJson != null) {
SVM_RELEASES_LIST_JSON = solcBuildsListJson;
};
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
just
rust-bin.stable.latest.default
];
};
}
);
}