Document the parameters and also accept an extras parameter

This commit is contained in:
Jean-Paul Calderone 2022-01-27 16:17:37 -05:00
parent 6154be1a96
commit 60dd2ee413

View File

@ -1,14 +1,27 @@
let
sources = import nix/sources.nix;
in
{ pkgsVersion ? "nixpkgs-21.11"
, pkgs ? import sources.${pkgsVersion} { }
, pypiData ? sources.pypi-deps-db
, pythonVersion ? "python37"
, mach-nix ? import sources.mach-nix {
{
pkgsVersion ? "nixpkgs-21.11" # a string which choses a nixpkgs from the
# niv-managed sources data
, pkgs ? import sources.${pkgsVersion} { } # nixpkgs itself
, pypiData ? sources.pypi-deps-db # the pypi package database snapshot to use
# for dependency resolution
, pythonVersion ? "python37" # a string chosing the python derivation from
# nixpkgs to target
, extras ? [] # a list of strings identifying tahoe-lafs extras, the
# dependencies of which the resulting package will also depend
# on
, mach-nix ? import sources.mach-nix { # the mach-nix package to use to build
# the tahoe-lafs package
inherit pkgs pypiData;
python = pythonVersion;
}
}
}:
# The project name, version, and most other metadata are automatically
# extracted from the source. Some requirements are not properly extracted
@ -22,6 +35,9 @@ mach-nix.buildPythonPackage {
# re-build when files that make no difference to the package have changed.
src = pkgs.lib.cleanSource ./.;
# Select whichever package extras were requested.
inherit extras;
# Define some extra requirements that mach-nix does not automatically detect
# from inspection of the source. We typically don't need to put version
# constraints on any of these requirements. The pypi-deps-db we're