diff --git a/new.nix b/new.nix index 3974dae3ecc8a6be0fb3c5a9d2c2c122b96f0b6e..c8db100db4fde872c1a057dd24899cc362ab3acb 100644 --- a/new.nix +++ b/new.nix @@ -9,6 +9,7 @@ in let providers = { _default = "sdist,nixpkgs,wheel"; + tahoe-lafs = "nixpkgs"; # not packaged in nixpkgs at all, we can use the binary wheel from # pypi though. python-challenge-bypass-ristretto = "wheel"; @@ -26,30 +27,49 @@ in tahoe-versions = { "1.14.0" = { requirements = builtins.readFile ./requirements/base.txt; - propagatedBuildInputs = []; + overridesPre = []; + _.tahoe-lafs.patches = [ + ( + pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/PrivateStorageio/nixpkgs/privatestorageio/pkgs/development/python-modules/tahoe-lafs/rsa-exponent.patch"; + sha256 = "sha256-0vIMj5gZPbKLkow6wpA+Tz7bpyy+mZRSSFGmpg0VMyk="; + } + ) + ]; }; "1.16.0rc1" = rec { requirements = builtins.readFile ./requirements/base-1.16.txt; - propagatedBuildInputs = [ + _ = {}; + overridesPre = [ ( - mach-nix.buildPythonPackage { - python = "python27"; - pname = "tahoe-lafs"; - version = "1.16.0rc1"; - inherit requirements providers; - postPatch = '' - cat > src/allmydata/_version.py <<EOF - # This _version.py is generated by nix. + self: super: { + tahoe-lafs = mach-nix.buildPythonPackage { + python = "python27"; + pname = "tahoe-lafs"; + version = "1.16.0rc1"; + inherit providers; + #inherit requirements providers; + # See https://github.com/DavHau/mach-nix/issues/190 + requirementsExtra = '' + pyrsistent + foolscap == 0.13.1 + configparser + eliot + ''; + postPatch = '' + cat > src/allmydata/_version.py <<EOF + # This _version.py is generated by nix. - verstr = "$version" - __version__ = verstr - EOF + verstr = "$version" + __version__ = verstr + EOF ''; - src = pkgs.fetchFromGitHub { - owner = "fenn-cs"; - repo = "tahoe-lafs"; - rev = "f6a96ae3976ee21ad0376f7b6a22fc3d12110dce"; - sha256 = "ZN2V5vH+VqPaBmQXXqyH+vUiqW1YNhz+7LsiNNhA/4g="; + src = pkgs.fetchFromGitHub { + owner = "fenn-cs"; + repo = "tahoe-lafs"; + rev = "f6a96ae3976ee21ad0376f7b6a22fc3d12110dce"; + sha256 = "ZN2V5vH+VqPaBmQXXqyH+vUiqW1YNhz+7LsiNNhA/4g="; + }; }; } ) @@ -57,24 +77,16 @@ in }; }; in -# (builtins.elemAt tahoe-versions."1.16.0rc1".propagatedBuildInputs 0) -#/* - mach-nix.buildPythonApplication rec { - python = "python27"; - name = "zero-knowledge-access-pass-authorizer"; - src = ./.; - inherit providers; - inherit (tahoe-versions.${tahoe-lafs}) requirements propagatedBuildInputs; - _.tahoe-lafs.patches = [ - ( - pkgs.fetchpatch { - url = "https://raw.githubusercontent.com/PrivateStorageio/nixpkgs/privatestorageio/pkgs/development/python-modules/tahoe-lafs/rsa-exponent.patch"; - sha256 = "sha256-0vIMj5gZPbKLkow6wpA+Tz7bpyy+mZRSSFGmpg0VMyk="; - } - ) - ]; - format = "setuptools"; - # Record some settings here, so downstream nix files can consume them. - meta.mach-nix = { inherit python providers; }; - } - /**/ + # (builtins.elemAt tahoe-versions."1.16.0rc1".propagatedBuildInputs 0) + #/* + mach-nix.buildPythonApplication rec { + python = "python27"; + name = "zero-knowledge-access-pass-authorizer"; + src = ./.; + inherit providers; + inherit (tahoe-versions.${tahoe-lafs}) requirements overridesPre _; + format = "setuptools"; + # Record some settings here, so downstream nix files can consume them. + meta.mach-nix = { inherit python providers; }; + } +/**/ diff --git a/requirements/base-1.16.txt b/requirements/base-1.16.txt index ef84c2b7aa0fbe1e500c0bf70f880507afb03534..bcece6ed42c7bc870af9ba277ba487f8322d6dab 100644 --- a/requirements/base-1.16.txt +++ b/requirements/base-1.16.txt @@ -115,6 +115,7 @@ pyopenssl==21.0.0 # via # foolscap # twisted +tahoe-lafs pyrsistent==0.16.1 # via # eliot