merged-packages.nix 1.0 KB

123456789101112131415161718192021222324252627282930
  1. { add_pkgs_path }:
  2. let
  3. dfl_nixpkgs = import ./nixpkgs-24.05.nix {};
  4. dfl_python = pkgs.python312;
  5. null_pkgs = {
  6. system-packages = {};
  7. python-packages = {};
  8. };
  9. usr_pkgs_path = if builtins.pathExists ~/.mmgen/user-packages.nix then
  10. ~/.mmgen/user-packages.nix else ./user-packages.nix;
  11. usr_pkgs = import usr_pkgs_path { pkgs = dfl_nixpkgs; python = dfl_python; bdir = ./.; };
  12. pkgs = if usr_pkgs?pkgs then usr_pkgs.pkgs else dfl_nixpkgs;
  13. python = if usr_pkgs?pkgs then usr_pkgs.python else dfl_python;
  14. wallet_pkgs = import ./packages.nix { pkgs = pkgs; python = python; };
  15. add_pkgs = if add_pkgs_path == null then null_pkgs else
  16. (import add_pkgs_path { pkgs = pkgs; python = python; });
  17. in
  18. wallet_pkgs.system-packages //
  19. add_pkgs.system-packages //
  20. usr_pkgs.system-packages //
  21. {
  22. pyenv = python.withPackages (ps:
  23. builtins.attrValues (
  24. wallet_pkgs.python-packages //
  25. add_pkgs.python-packages //
  26. usr_pkgs.python-packages)
  27. );
  28. }