2022-01-27 18:00:36 +00:00
|
|
|
let
|
2022-01-28 15:46:13 +00:00
|
|
|
# sources.nix contains information about which versions of some of our
|
2023-03-13 20:36:53 +00:00
|
|
|
# dependencies we should use. since we use it to pin nixpkgs, all the rest
|
|
|
|
# of our dependencies are *also* pinned - indirectly.
|
2022-01-28 15:46:13 +00:00
|
|
|
#
|
|
|
|
# sources.nix is managed using a tool called `niv`. as an example, to
|
|
|
|
# update to the most recent version of nixpkgs from the 21.11 maintenance
|
|
|
|
# release, in the top-level tahoe-lafs checkout directory you run:
|
|
|
|
#
|
|
|
|
# niv update nixpkgs-21.11
|
|
|
|
#
|
|
|
|
# niv also supports chosing a specific revision, following a different
|
|
|
|
# branch, etc. find complete documentation for the tool at
|
|
|
|
# https://github.com/nmattia/niv
|
2022-01-27 18:00:36 +00:00
|
|
|
sources = import nix/sources.nix;
|
|
|
|
in
|
2022-01-27 21:17:37 +00:00
|
|
|
{
|
2023-03-13 19:19:43 +00:00
|
|
|
pkgsVersion ? "nixpkgs-22.11" # a string which chooses a nixpkgs from the
|
2022-01-27 21:17:37 +00:00
|
|
|
# niv-managed sources data
|
|
|
|
|
|
|
|
, pkgs ? import sources.${pkgsVersion} { } # nixpkgs itself
|
|
|
|
|
2023-03-13 19:19:43 +00:00
|
|
|
, pythonVersion ? "python310" # a string choosing the python derivation from
|
|
|
|
# nixpkgs to target
|
2022-01-27 21:17:37 +00:00
|
|
|
|
2023-03-13 21:02:10 +00:00
|
|
|
, extrasNames ? [ "tor" "i2p" ] # a list of strings identifying tahoe-lafs extras,
|
|
|
|
# the dependencies of which the resulting
|
|
|
|
# package will also depend on. Include all of the
|
|
|
|
# runtime extras by default because the incremental
|
|
|
|
# cost of including them is a lot smaller than the
|
|
|
|
# cost of re-building the whole thing to add them.
|
2022-01-27 21:17:37 +00:00
|
|
|
|
2022-01-27 18:00:36 +00:00
|
|
|
}:
|
2023-03-13 23:03:26 +00:00
|
|
|
with (pkgs.${pythonVersion}.override {
|
2023-03-21 12:57:21 +00:00
|
|
|
packageOverrides = import ./nix/python-overrides.nix;
|
2023-03-13 23:03:26 +00:00
|
|
|
}).pkgs;
|
2023-03-13 19:19:43 +00:00
|
|
|
callPackage ./nix/tahoe-lafs.nix {
|
2022-01-27 21:17:37 +00:00
|
|
|
# Select whichever package extras were requested.
|
2023-03-13 21:02:10 +00:00
|
|
|
inherit extrasNames;
|
2022-01-27 21:17:37 +00:00
|
|
|
|
2023-03-15 00:40:08 +00:00
|
|
|
# Define the location of the Tahoe-LAFS source to be packaged (the same
|
|
|
|
# directory as contains this file). Clean up as many of the non-source
|
|
|
|
# files (eg the `.git` directory, `~` backup files, nix's own `result`
|
|
|
|
# symlink, etc) as possible to avoid needing to re-build when files that
|
|
|
|
# make no difference to the package have changed.
|
2023-03-13 19:19:43 +00:00
|
|
|
tahoe-lafs-src = pkgs.lib.cleanSource ./.;
|
2022-01-27 21:27:10 +00:00
|
|
|
|
2023-03-13 23:03:26 +00:00
|
|
|
doCheck = false;
|
2022-01-27 18:00:36 +00:00
|
|
|
}
|