From 84b0843be3a8e5620b74757ae7849b3b7f588df6 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 11 Sep 2025 17:37:10 +0000 Subject: [PATCH] update Nix configuration --- mmgen/data/version | 2 +- nix/README | 6 +++++ nix/bitcoin-cash-node.nix | 4 +++- nix/go-ethereum.nix | 1 + nix/litecoin.nix | 6 +++-- nix/merged-packages.nix | 4 ++-- nix/nixpkgs-24.05.nix | 7 ------ nix/nixpkgs-24.11.nix | 8 ------- nix/nixpkgs-25.05.nix | 9 +++++++ nix/packages.nix | 9 +------ nix/reth.nix | 48 ++++++++++++++++++++++++++++++++++++++ nix/user-packages.nix | 25 +++++++++++++------- nix/vanitygen-plusplus.nix | 2 ++ nix/zcash-mini.nix | 2 ++ 14 files changed, 96 insertions(+), 37 deletions(-) delete mode 100644 nix/nixpkgs-24.05.nix delete mode 100644 nix/nixpkgs-24.11.nix create mode 100644 nix/nixpkgs-25.05.nix create mode 100644 nix/reth.nix diff --git a/mmgen/data/version b/mmgen/data/version index fac52cd8..e8fe8c66 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -15.1.dev54 +15.1.dev55 diff --git a/nix/README b/nix/README index 4490e539..b79dcac2 100644 --- a/nix/README +++ b/nix/README @@ -39,6 +39,12 @@ will make executables from your native environment inaccessible within the shell, so you may need to add some additional tools to your environment such as a text editor. For examples, refer to ‘user-packages.nix’ +Speedup tip: Look for the commented-out ‘url =’ lines in the *.nix files in +this directory, and make local shallow clones of the corresponding remote git +repositories using ‘git clone --depth=1’ plus ‘--revision=’ or +‘--branch=’. Then uncomment the local paths, adjusting them to suit. +This will also allow you to use your installation in an offline environment. + NixOS: To install the MMGen Wallet environment under NixOS, copy the contents of the ‘nix’ diff --git a/nix/bitcoin-cash-node.nix b/nix/bitcoin-cash-node.nix index 25f5ad67..dd6457cd 100644 --- a/nix/bitcoin-cash-node.nix +++ b/nix/bitcoin-cash-node.nix @@ -5,13 +5,15 @@ pkgs.stdenv.mkDerivation rec { version = "v28.0.1"; src = fetchGit { url = "https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node"; + # url = /path/to/repo/bitcoin-cash-node-28.0.1; ref = "refs/tags/${version}"; + shallow = true; }; nativeBuildInputs = [ pkgs.cmake pkgs.ninja pkgs.help2man - pkgs.python3 + pkgs.python313 ]; buildInputs = [ pkgs.boost diff --git a/nix/go-ethereum.nix b/nix/go-ethereum.nix index 87f10a94..c1329630 100644 --- a/nix/go-ethereum.nix +++ b/nix/go-ethereum.nix @@ -1,4 +1,5 @@ # adapted from go-ethereum.nix in nixpkgs repository +# not currently used, as nixpkgs 25.05 go-ethereum (v1.15.11) is OK { pkgs, diff --git a/nix/litecoin.nix b/nix/litecoin.nix index 05bab04f..392d39bd 100644 --- a/nix/litecoin.nix +++ b/nix/litecoin.nix @@ -5,7 +5,9 @@ pkgs.stdenv.mkDerivation rec { version = "v0.21.4"; src = fetchGit { url = "https://github.com/litecoin-project/litecoin.git"; + # url = /path/to/repo/litecoin-0.21.4.git; ref = "refs/tags/${version}"; + shallow = true; }; nativeBuildInputs = [ pkgs.autoconf @@ -15,7 +17,7 @@ pkgs.stdenv.mkDerivation rec { # pkgs.hexdump # for tests ]; buildInputs = [ - pkgs.boost + pkgs.boost183 # 'fs::copy_option' was removed in Boost 1.84 pkgs.libevent pkgs.fmt pkgs.db4 @@ -30,7 +32,7 @@ pkgs.stdenv.mkDerivation rec { "--with-sqlite" "--disable-bench" "--disable-tests" - "--with-boost-libdir=${pkgs.boost.out}/lib" + "--with-boost-libdir=${pkgs.boost183.out}/lib" ]; buildFlags = [ "src/litecoind" diff --git a/nix/merged-packages.nix b/nix/merged-packages.nix index e028000a..0b3cd53e 100644 --- a/nix/merged-packages.nix +++ b/nix/merged-packages.nix @@ -1,8 +1,8 @@ { add_pkgs_path }: let - dfl_nixpkgs = import ./nixpkgs-24.11.nix {}; - dfl_python = pkgs.python312; + dfl_nixpkgs = import ./nixpkgs-25.05.nix {}; + dfl_python = pkgs.python313; null_pkgs = { system-packages = {}; python-packages = {}; diff --git a/nix/nixpkgs-24.05.nix b/nix/nixpkgs-24.05.nix deleted file mode 100644 index 12ebf949..00000000 --- a/nix/nixpkgs-24.05.nix +++ /dev/null @@ -1,7 +0,0 @@ -import ( - fetchGit { - url = "https://github.com/NixOS/nixpkgs.git"; - rev = "63dacb46bf939521bdc93981b4cbb7ecb58427a0"; # refs/tags/24.05 - shallow = true; - } -) diff --git a/nix/nixpkgs-24.11.nix b/nix/nixpkgs-24.11.nix deleted file mode 100644 index 82109a23..00000000 --- a/nix/nixpkgs-24.11.nix +++ /dev/null @@ -1,8 +0,0 @@ -import ( - fetchGit { - url = "https://github.com/NixOS/nixpkgs.git"; - ref = "release-24.11"; - rev = "8b27c1239e5c421a2bbc2c65d52e4a6fbf2ff296"; # refs/tags/24.11 - shallow = true; - } -) diff --git a/nix/nixpkgs-25.05.nix b/nix/nixpkgs-25.05.nix new file mode 100644 index 00000000..3087c96f --- /dev/null +++ b/nix/nixpkgs-25.05.nix @@ -0,0 +1,9 @@ +import ( + fetchGit { + url = "https://github.com/NixOS/nixpkgs.git"; + # url = /path/to/repo/nixpkgs-25.05.git; + ref = "release-25.05"; + rev = "11cb3517b3af6af300dd6c055aeda73c9bf52c48"; # refs/tags/25.05 + shallow = true; + } +) diff --git a/nix/packages.nix b/nix/packages.nix index b4f33b30..05e8bf2c 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -10,17 +10,10 @@ libtool = libtool; autoconf = autoconf; gmp = gmp; - gmp4 = gmp4; openssl = openssl; pcre = pcre; mpfr = mpfr; - secp256k1 = secp256k1.overrideAttrs { - pname = "secp256k1-v0.6.0"; - src = fetchGit { - url = "https://github.com/bitcoin-core/secp256k1.git"; - ref = "refs/tags/v0.6.0"; - }; - }; + secp256k1 = secp256k1; less = less; # test suite (cmdtest.py regtest) procps = procps; # test suite (pgrep) ruff = ruff; diff --git a/nix/reth.nix b/nix/reth.nix new file mode 100644 index 00000000..fabb3dff --- /dev/null +++ b/nix/reth.nix @@ -0,0 +1,48 @@ +{ + lib, + pkgs, + rustPlatform, +}: + +let + # cargo and rustc packages from 25.05 are out of date, + # so fetch them from a more recent commit: + pinnedPkgs = fetchGit { + url = "https://github.com/NixOS/nixpkgs.git"; + # url = /path/to/repo/nixpkgs-fe8997.git; + rev = "fe89979ad5e8fd233ae0aac0e7e56f465945ae70"; + shallow = true; + }; + pkgs2 = import pinnedPkgs {}; + +in + +rustPlatform.buildRustPackage rec { + pname = "reth"; + version = "1.7.0"; + + src = fetchGit { + url = "https://github.com/paradigmxyz/reth"; + # url = /path/to/repo/reth; + ref = "refs/tags/v${version}"; + shallow = true; + }; + + cargoHash = "sha256-2zdilVIHCW0N2yZNfLNoVpTASjXU1ABcZzQLzpAGEsY="; + + nativeBuildInputs = [ + pkgs.clang + pkgs.libclang + pkgs2.rustc + pkgs2.cargo + ]; + + env.LIBCLANG_PATH = pkgs.libclang.lib + "/lib/"; + + meta = with lib; { + description = "Rust Ethereum daemon"; + homepage = "https://github.com/paradigmxyz/reth"; + license = licenses.mit; + mainProgram = "reth"; + }; +} diff --git a/nix/user-packages.nix b/nix/user-packages.nix index 0055ccb8..ca6a3a3c 100644 --- a/nix/user-packages.nix +++ b/nix/user-packages.nix @@ -8,31 +8,40 @@ rec { ### Set nixpkgs globally for the MMGen environment. ### If you set it, make sure to uncomment the python variable assignment below. - # pkgs = import (bdir + /nixpkgs-24.11.nix) {}; + # pkgs = import (bdir + /nixpkgs-25.05.nix) {}; ### Set python version globally for the MMGen environment. ### Must be set if pkgs is set. - # python = pkgs.python312; + # python = pkgs.python313; system-packages = with pkgs; { # monero-cli = monero-cli; # Monero daemon - # # go-ethereum = go-ethereum; # Geth - latest version for transacting on mainnet - # go-ethereum = callPackage (bdir + /go-ethereum.nix) { # Geth - old version for test suite (ethdev) - # buildGoModule = buildGo122Module; - # tag_version = "v1.13.15"; - # vendor_hash = "sha256-LWNFuF66KudxrpWBBXjMbrWP5CwEuPE2h3kGfILIII0"; - # }; + # go-ethereum = go-ethereum; # Geth + # reth = callPackage (bdir + /reth.nix) {}; # Rust Ethereum daemon # solc = callPackage (bdir + /solc.nix) {}; # Solidity compiler # litecoin = callPackage (bdir + /litecoin.nix) {}; # Litecoin daemon # bitcoin-cash = callPackage (bdir + /bitcoin-cash-node.nix) {}; # Bitcoin Cash Node daemon # zcash-mini = callPackage (bdir + /zcash-mini.nix) {}; # ZEC (test suite) ### For development with --pure (add/remove packages for your setup): + # neovim = neovim; # neovim-qt = neovim-qt; # rxvt-unicode = rxvt-unicode; # which = which; # ctags = ctags; # xclip = xclip; + # ruff = ruff; + # perl = perl; + # netcat = netcat-openbsd; + # jq = jq; + # ed = ed; + # rsync = rsync; + # pandoc = pandoc; + # gnupg = gnupg; + # iproute2 = iproute2; + # tinyxxd = tinyxxd; + # ranger = ranger; + # hostname = hostname; ### For test suite with --pure: # openssh = openssh; diff --git a/nix/vanitygen-plusplus.nix b/nix/vanitygen-plusplus.nix index 9805f3b5..b6315f71 100644 --- a/nix/vanitygen-plusplus.nix +++ b/nix/vanitygen-plusplus.nix @@ -5,7 +5,9 @@ pkgs.stdenv.mkDerivation { version = "e7858035"; src = fetchGit { url = "https://github.com/10gic/vanitygen-plusplus"; + # url = /path/to/repo/vanitygen-plusplus-e78580; rev = "e7858035d092f9b9d6468e2b812475faaf7c69c6"; + shallow = true; }; buildInputs = [ pkgs.openssl pkgs.pcre ]; installPhase = '' diff --git a/nix/zcash-mini.nix b/nix/zcash-mini.nix index dfad3d11..0420dc3a 100644 --- a/nix/zcash-mini.nix +++ b/nix/zcash-mini.nix @@ -5,7 +5,9 @@ pkgs.stdenvNoCC.mkDerivation { version = "a2b35042"; src = fetchGit { url = "https://github.com/FiloSottile/zcash-mini"; + # url = /path/to/repo/zcash-mini-a2b350; rev = "a2b35042ad3a3bc22b925ecfc45e768a376bd29a"; + shallow = true; }; buildInputs = [ pkgs.go pkgs.binutils ]; patchPhase = ''