dapptools
dapptools copied to clipboard
Add flake support
Having flake support would make dapptools easier to work with when managing projects with nix's flakes.
While we wait for proper flake support, here's my shell.nix
, to avoid having to to use nix-env
, if anyone finds it useful:
{ pkgs ? import <nixpkgs> {} }:
let
dapp = import (builtins.fetchTarball https://github.com/dapphub/dapptools/archive/master.tar.gz) { };
in
pkgs.mkShell {
buildInputs = with pkgs; [
# other pkgs with current 'nixpkgs' go here
# ...
# dapptools packages
dapp.dapp
dapp.seth
# ...
# custom solc version in shell
(dapp.runCommand "solc" { } "mkdir -p $out/bin; ln -s ${dapp.solc-static-versions.solc_0_8_10}/bin/solc-0.8.10 $out/bin/solc")
];
}
And to use the binary cache with the above, enable cachix use dapp
, or add these nix config options to your host:
{
nix = {
binaryCaches = [
"https://dapp.cachix.org"
];
binaryCachePublicKeys = [
"dapp.cachix.org-1:9GJt9Ja8IQwR7YW/aF0QvCa6OmjGmsKoZIist0dG+Rs="
];
};
}
one very easy win for flake compatibility (without writing a full on flake.nix for dapptools) would be to allow pure evaluation of the dapptools nix expressions.
@andrevmatos it's a little off topic for this issue imo, but your shell.nix can IMO be made a little tidier by:
- pinning a specific dapptools commit and using the version of nixpkgs from the dapptools repo
- using the
DAPP_SOLC
env var to specify the custom solc version (see here for an example).
flake is the now suggested method for install dapptools, this can be closed I would think.
Sadly,
flake 'github:dapphub/dapptools' does not provide attribute 'packages.aarch64-darwin.dapp', 'legacyPackages.aarch64-darwin.dapp' or 'dapp'
@sambacha
I have flake installed but I still get the error below. Do you know a way around this error?
flake 'github:dapphub/dapptools' does not provide attribute 'packages.aarch64-darwin.dapp', 'legacyPackages.aarch64-darwin.dapp' or 'dapp'