README 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Nix configuration directory for the MMGen Wallet suite
  2. NOTE: If you plan to make changes to the files in this directory, first copy it
  3. (e.g. `cp -a nix mynix`) and then make your changes in the copied directory.
  4. Also make sure to replace ‘nix’ with ‘mynix’ (e.g.) in the examples below.
  5. Only BTC and a bare minimum of packages are enabled by default.
  6. For altcoin and additional package support, copy the file ‘user-packages.nix’ to
  7. your MMGen datadir (~/.mmgen) and edit, uncommenting the relevant lines. For an
  8. XMR-enabled setup, for example, you’d uncomment the system package ‘monero-cli’
  9. and Python packages ‘monero’, ‘pycryptodome’ and ‘pysocks’.
  10. From the mmgen-wallet repo root, you may build individual system packages in the
  11. MMGen Wallet environment as follows (we’ll use the curl package in this example):
  12. $ nix-build nix --attr curl
  13. To build all configured packages in one go, run ‘nix-build nix’ without
  14. additional arguments.
  15. The last lines of nix-build’s output are store paths in ‘/nix/store/’, which
  16. you may optionally install into your default environment as follows:
  17. $ nix-env --install <store path>
  18. Note that use of MMGen Wallet from the default environment is discouraged in
  19. favor of the custom shell environment, which we’ll now describe.
  20. From the mmgen-wallet repo root, execute:
  21. $ nix-shell nix
  22. This will build any unbuilt configured packages and drop you to the custom shell
  23. environment. At this point you may run the test suite:
  24. [nix-shell:... $] test/test-release -FA
  25. or proceed to use MMGen Wallet as with any conventional installation.
  26. For greater isolation, you can invoke nix-shell with the ‘--pure’ option. This
  27. will make executables from your native environment inaccessible within the
  28. shell, so you may need to add some additional tools to your environment such as
  29. a text editor. For examples, refer to ‘user-packages.nix’
  30. Speedup tip: Look for the commented-out ‘url =’ lines in the *.nix files in
  31. this directory, and make local shallow clones of the corresponding remote git
  32. repositories using ‘git clone --depth=1’ plus ‘--revision=<commit>’ or
  33. ‘--branch=<tag>’. Then uncomment the local paths, adjusting them to suit.
  34. This will also allow you to use your installation in an offline environment.
  35. NixOS:
  36. To install the MMGen Wallet environment under NixOS, copy the contents of the ‘nix’
  37. directory to ‘/etc/nixos/mmgen-project’ and add ‘./mmgen-project/nixos-packages.nix’
  38. to your imports list in ‘configuration.nix’. If altcoin support or additional
  39. packages are required, edit ‘user-packages.nix’ in ‘/etc/nixos/mmgen-project’ as
  40. described above for the copy of that file in the MMGen datadir. Rebuild NixOS.
  41. From the mmgen-wallet repo root, execute:
  42. export PYTHONPATH=$(pwd)
  43. export PATH=$(pwd)/cmds:$PATH
  44. You can now test and use MMGen Wallet in your native shell environment.