Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake support #874

Open
wanderer opened this issue Nov 28, 2021 · 5 comments
Open

Add flake support #874

wanderer opened this issue Nov 28, 2021 · 5 comments

Comments

@wanderer
Copy link

Having flake support would make dapptools easier to work with when managing projects with nix's flakes.

@andrevmatos
Copy link

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="
    ];
  };
}

@d-xo
Copy link
Contributor

d-xo commented Jan 8, 2022

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.

@d-xo
Copy link
Contributor

d-xo commented Jan 8, 2022

@andrevmatos it's a little off topic for this issue imo, but your shell.nix can IMO be made a little tidier by:

  1. pinning a specific dapptools commit and using the version of nixpkgs from the dapptools repo
  2. using the DAPP_SOLC env var to specify the custom solc version (see here for an example).

@sambacha
Copy link

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'

@PrintRH
Copy link

PrintRH commented Sep 28, 2023

@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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants