2022-12-22 16:25:09 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
devenv.url = "github:cachix/devenv";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-21 00:18:31 +00:00
|
|
|
foundry = {
|
|
|
|
url = "github:shazow/foundry.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-12-22 16:25:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
{ self
|
|
|
|
, nixpkgs
|
|
|
|
, flake-utils
|
|
|
|
, fenix
|
2023-02-21 00:18:31 +00:00
|
|
|
, foundry
|
2022-12-22 16:25:09 +00:00
|
|
|
, devenv
|
|
|
|
} @ inputs:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShell = devenv.lib.mkShell {
|
|
|
|
inherit inputs pkgs;
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
{
|
|
|
|
packages = with pkgs; [
|
|
|
|
solc
|
2023-02-21 00:18:31 +00:00
|
|
|
gcc
|
|
|
|
foundry.defaultPackage.${system}
|
|
|
|
go-ethereum
|
2022-12-22 16:25:09 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk; [
|
|
|
|
libiconv
|
|
|
|
frameworks.Security
|
|
|
|
]);
|
|
|
|
|
|
|
|
# https://devenv.sh/languages/
|
|
|
|
languages.nix.enable = true;
|
|
|
|
languages.rust = {
|
|
|
|
enable = true;
|
|
|
|
version = "stable";
|
|
|
|
packages = {
|
|
|
|
rustfmt = inputs.fenix.packages.${pkgs.system}.latest.rustfmt;
|
|
|
|
clippy = inputs.fenix.packages.${pkgs.system}.latest.clippy;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# https://devenv.sh/pre-commit-hooks/
|
|
|
|
pre-commit.hooks = {
|
|
|
|
shellcheck.enable = true;
|
|
|
|
|
|
|
|
clippy.enable = true;
|
|
|
|
rustfmt.enable = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|