1{
2 lib,
3 buildPythonPackage,
4 stdenv,
5 fetchFromGitHub,
6 # build dependencies
7 hatchling,
8 hatch-vcs,
9 # runtime dependencies
10 archspec,
11 conda-libmamba-solver,
12 conda-package-handling,
13 distro,
14 frozendict,
15 jsonpatch,
16 packaging,
17 platformdirs,
18 pluggy,
19 pycosat,
20 requests,
21 ruamel-yaml,
22 tqdm,
23 truststore,
24 # runtime options
25 defaultEnvPath ? "~/.conda/envs", # default path to store conda environments
26 defaultPkgPath ? "~/.conda/pkgs", # default path to store download conda packages
27}:
28buildPythonPackage rec {
29 __structuredAttrs = true;
30 pname = "conda";
31 version = "25.7.0";
32 pyproject = true;
33
34 src = fetchFromGitHub {
35 inherit pname version;
36 owner = "conda";
37 repo = "conda";
38 tag = version;
39 hash = "sha256-lvqR1ksYE23enSf4pxFpb/Z8yPoU9bVb4Hi2ZrhI0XA=";
40 };
41
42 build-system = [
43 hatchling
44 hatch-vcs
45 ];
46
47 dependencies = [
48 archspec
49 conda-libmamba-solver
50 conda-package-handling
51 distro
52 frozendict
53 jsonpatch
54 packaging
55 platformdirs
56 pluggy
57 pycosat
58 requests
59 ruamel-yaml
60 tqdm
61 truststore
62 ];
63
64 patches = [ ./0001-conda_exe.patch ];
65
66 makeWrapperArgs = [
67 "--set"
68 "CONDA_EXE"
69 "${placeholder "out"}/bin/conda"
70
71 "--set-default"
72 "CONDA_ENVS_PATH"
73 defaultEnvPath
74
75 "--set-default"
76 "CONDA_PKGS_DIRS"
77 defaultPkgPath
78 ];
79
80 pythonImportsCheck = [ "conda" ];
81
82 # menuinst is currently not packaged
83 pythonRemoveDeps = lib.optionals (!stdenv.hostPlatform.isWindows) [ "menuinst" ];
84
85 meta = {
86 description = "OS-agnostic, system-level binary package manager";
87 homepage = "https://github.com/conda/conda";
88 license = lib.licenses.bsd3;
89 maintainers = [ lib.maintainers.ericthemagician ];
90 };
91}