The official Nix package for mercurial describes the process of adding extensions is to use the provided withExtensions
as shown here: https://github.com/NixOS/nixpkgs/blob/c55537aa04e2d5b8de4614b79782d3e5430c3ea7/pkgs/applications/version-management/mercurial/default.nix#L170
In my configuration.nix
file I’ve added mercurial using the format specified:
let
mercurial_e = pkgs.mercurial.withExtensions (pm: [ pm.hg-evolve ]);
in
{
...
environment.systemPackages = with pkgs; [
mercurial_e
];
...
}
This installs fine, but it still fails to import the extension.
❯ hg
*** failed to import extension "evolve": No module named 'evolve'
*** failed to import extension "topic": No module named 'topic'
Following symlinks and inspecting the Python interpreter used by the installation shows that the hg-evolve
module isn’t installed. I’ve tried forgoing withExtensions
and adding it manually:
let
mercurial_e = pkgs.mercurial.overridePythonAttrs (oldAttrs: rec {
buildInputs = oldAttrs.buildInputs or [] ++ [ pkgs.python3Packages.hg-evolve ];
});
but unfortunately the outcome is the same.
My question: how can I install the hg-evolve
extension into the provided mercurial package, which should be as simple as making the hg-evolve
Python package available during runtime?
Note that the extensions are loaded by adding
[extensions]
evolve=
topic=
into one’s hgrc
file.