Last active
May 29, 2023 11:59
-
-
Save Pitometsu/c247945f8ef2db0aefc7b393596b4de3 to your computer and use it in GitHub Desktop.
Internet Computer development environment with dfx and mops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; with builtins; let | |
dfx-env = import (fetchTarball https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz) {}; | |
mops-nix = https://raw.githubusercontent.com/nomeata/ic-certification/3f51849073d19d2ab46aaff3c4985bf8c60196a1; | |
nodeEnv = import (fetchurl "${mops-nix}/mops.nix/node-env.nix") { | |
nodejs = nodejs-14_x; | |
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; | |
inherit pkgs; | |
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; | |
}; | |
mops = (import (fetchurl "${mops-nix}/mops.nix/node-packages.nix") { | |
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; | |
inherit nodeEnv; | |
}).ic-mops; | |
in dfx-env.overrideAttrs (old: { | |
nativeBuildInputs = old.nativeBuildInputs ++ [ | |
mops wasmtime gnumake | |
coreutils cacert gnupg openssh | |
less which tree ripgrep gitMinimal | |
]; | |
}) |
For direnv
integration with the code editor of your choice:
nix profile install nixpkgs#direnv
nix profile install nixpkgs#nix-direnv
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > ~/.config/direnv/direnvrc
cat >> ~/.config/nix/nix.conf <<EOF
keep-derivations = true
keep-outputs = true
EOF
echo 'use nix --pure --keep DIRENV_DUMP_FILE_PATH https://codeload.github.com/gist/c247945f8ef2db0aefc7b393596b4de3/zip/2b7a7c36d0321373afa93b7ce21b4687e4754791
' > ./.envrc
direnv allow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a mix of https://github.com/ninegua/ic-nix and https://github.com/nomeata/ic-certification/blob/main/mops.nix/default.nix for convenient: