Datalad is an interesting project which I had lots of fun with. But I have problems in using its extension datalad-container. It isn’t yet packaged for nix so I wrote one looking something like this:
{
lib,
python3,
fetchFromGitHub,
datalad,
git,
}:
python3.pkgs.buildPythonApplication rec {
pname = "datalad-container";
version = "1.2.5";
pyproject = true;
src = fetchFromGitHub {
owner = "datalad";
repo = "datalad-container";
rev = version;
hash = "sha256-ueqVyCSnEkJBb21X+EM2OC6fJ1/t0YXcaES0CT4/npI=";
};
build-system = [
python3.pkgs.setuptools
python3.pkgs.tomli
python3.pkgs.wheel
];
nativeBuildInputs = [
git
];
propagatedBuildInputs = [
datalad
python3.pkgs.requests
];
pythonImportsCheck = [
"datalad_container"
];
meta = {
description = "DataLad extension for containerized environments";
homepage = "https://github.com/datalad/datalad-container";
changelog = "https://github.com/datalad/datalad-container/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ malik ];
mainProgram = "datalad-container";
};
}
Based on the documentation of the Datalad book the datalad container commands should be available es soon after the installation of the extension with pip.
But with my package definitions installing datalad and dataladContainer at the same time still does not make the commands available:
datalad containers-add
datalad: Unknown command 'containers-add'. See 'datalad --help'.
Hint: Command containers-add is provided by (not installed) extension datalad-container.