Nix support improvements

Quick Start for BTC:

    $ git clone https://github.com/mmgen/mmgen-wallet
    $ cd mmgen-wallet
    $ nix-shell --pure nix

Enable altcoins and additional packages:

    $ mkdir -p ~/.mmgen
    $ cp nix/user-packages.nix ~/.mmgen
    # ... edit ~/.mmgen/user-packages.nix as required ...
    $ nix-shell --pure nix

For NixOS installation and other information, see:

    nix/README
This commit is contained in:
The MMGen Project 2025-01-03 14:23:20 +00:00
commit abbc9c843a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
18 changed files with 199 additions and 130 deletions

29
nix/zcash-mini.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs }:
pkgs.stdenvNoCC.mkDerivation {
pname = "zcash-mini";
version = "a2b35042";
src = fetchGit {
url = "https://github.com/FiloSottile/zcash-mini";
rev = "a2b35042ad3a3bc22b925ecfc45e768a376bd29a";
};
buildInputs = [ pkgs.go pkgs.binutils ];
patchPhase = ''
sed -e "s@github.com/FiloSottile/@@" -i main.go
sed -e "s@github.com/FiloSottile/@@" -i zcash/address.go
sed -e "s@github.com/btcsuite@zcash-mini@" -i zcash/address.go
sed -e "s@golang.org/x@zcash-mini@" -i zcash/address.go
mv vendor/github.com/btcsuite/btcutil .
mv vendor/golang.org/x/crypto .
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
export HOME=$TMPDIR
go mod init zcash-mini
go build -mod=mod
mkdir --parents $out/bin
install --strip --mode=755 zcash-mini $out/bin
'';
dontFixup = true;
}