Newer
Older
let
sources = import nix/sources.nix;
in
{ pkgs ? import sources.release2015 {}
, pypiData ? sources.pypi-deps-db
, mach-nix ? import sources.mach-nix { inherit pkgs pypiData; }
# mach-nix doesn't provide a good way to depend on mach-nix packages,
# so we get it as a nixpkgs dependency from an overlay. See below for
# details.
# not packaged in nixpkgs at all, we can use the binary wheel from
# pypi though.
python-challenge-bypass-ristretto = "wheel";
# Pure python packages that don't build correctly from sdists
# - patches in nixpkgs that don't apply
boltons = "wheel";
chardet = "wheel";
urllib3 = "wheel";
# - incorrectly detected dependencies due to pbr
fixtures = "wheel";
testtools = "wheel";
traceback2 = "wheel";
# - Incorrectly merged extras - https://github.com/DavHau/mach-nix/pull/334
tqdm = "wheel";
in
rec {
tahoe-lafs = mach-nix.buildPythonPackage rec {
inherit python providers;
name = "tahoe-lafs";
version = "1.16.post999";
# See https://github.com/DavHau/mach-nix/issues/190
requirementsExtra = ''
pyrsistent < 0.17
foolscap == 0.13.1
configparser
eliot
postPatch = ''
cat > src/allmydata/_version.py <<EOF
# This _version.py is generated by nix.
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
verstr = "${version}+git-${tahoe-lafs-repo.rev}"
__version__ = verstr
EOF
'';
src = tahoe-lafs-repo;
};
zkapauthorizer = mach-nix.buildPythonApplication rec {
inherit python providers;
src = ./.;
# mach-nix does not provide a way to specify dependencies on other
# mach-nix packages, that incorporates the requirements and overlays
# of that package.
# See https://github.com/DavHau/mach-nix/issues/123
# In particular, we explicitly include the requirements of tahoe-lafs
# here, and include it in a python package overlay.
requirementsExtra = tahoe-lafs.requirements;
overridesPre = [
(
self: super: {
inherit tahoe-lafs;
}
)
];
# Record some settings here, so downstream nix files can consume them.
meta.mach-nix = { inherit python providers; };
};
privatestorage = let
python-env = mach-nix.mkPython {
inherit python providers;
packagesExtra = [ zkapauthorizer tahoe-lafs ];
};
in
pkgs.runCommandNoCC "privatestorage" {}
''
mkdir -p $out/bin
ln -s ${python-env}/bin/tahoe $out/bin
'';