nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3,
4 runCommand,
5}:
6
7let
8 python = python3;
9
10 # selector is a function mapping pythonPackages to a list of plugins
11 # e.g. `mdformat.withPlugins (ps: with ps; [ mdformat-footnote ])`
12 withPlugins =
13 selector:
14 runCommand "mdformat-wrapped"
15 {
16 inherit (python.pkgs.mdformat) pname version meta;
17
18 nativeBuildInputs = [
19 python.pkgs.wrapPython
20 ];
21
22 plugins = selector python.pkgs;
23
24 passthru = {
25 inherit withPlugins;
26 };
27 }
28 ''
29 buildPythonPath "$plugins"
30 makeWrapper ${lib.getExe python.pkgs.mdformat} $out/bin/mdformat \
31 --suffix PYTHONPATH : "$program_PYTHONPATH"
32 '';
33in
34withPlugins (ps: [ ])