From 60dd2ee413dcc5f2b2dc2bc484a9fc6a9a73e5d7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Thu, 27 Jan 2022 16:17:37 -0500 Subject: [PATCH] Document the parameters and also accept an `extras` parameter --- default.nix | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/default.nix b/default.nix index 970fd75ca..d5acbbdd7 100644 --- a/default.nix +++ b/default.nix @@ -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