diff --git a/autobahn.nix b/autobahn.nix new file mode 100644 index 0000000000000000000000000000000000000000..5403cd5c8dc65d3daec3062b4eec535bd9b3cb70 --- /dev/null +++ b/autobahn.nix @@ -0,0 +1,11 @@ +{ fetchFromGitHub, autobahn }: +autobahn.overrideAttrs (old: rec { + pname = "autobahn"; + version = "19.7.1"; + src = fetchFromGitHub { + owner = "crossbario"; + repo = "autobahn-python"; + rev = "v${version}"; + sha256 = "1gl2m18s77hlpiglh44plv3k6b965n66ylnxbzgvzcdl9jf3l3q3"; + }; +}) diff --git a/cryptography.nix b/cryptography.nix new file mode 100644 index 0000000000000000000000000000000000000000..dc61091ba397fc0c1d6c0ebaf7f8192040201f55 --- /dev/null +++ b/cryptography.nix @@ -0,0 +1,11 @@ +{ fetchFromGitHub, cryptography }: +cryptography.overrideAttrs (old: rec { + pname = "cryptography"; + version = "2.7"; + src = fetchFromGitHub { + owner = "pyca"; + repo = "cryptography"; + rev = "2.7"; + sha256 = "145byri5c3b8m6dbhwb6yxrv9jrr652l3z1w16mz205z8dz38qja"; + }; +}) diff --git a/default.nix b/default.nix index 0a9c3cf10ec844c3e712aafcbc1e0a426f73b50c..541516016c036faac170dc6c32087293035ce859 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,5 @@ { pkgs ? import <nixpkgs> { } }: let - eliot = pkgs.pythonPackages.callPackage ./eliot.nix { }; - - # tahoe-lafs in nixpkgs is packaged as an application! so we have to - # re-package it ourselves as a library. - tahoe-lafs = pkgs.pythonPackages.callPackage ./tahoe-lafs.nix { - inherit eliot; - }; - + newpkgs = import pkgs.path { overlays = [ import ./overlays.nix ]; }; in - pkgs.pythonPackages.callPackage ./secure-access-token-authorizer.nix { - inherit tahoe-lafs; - } + pkgs.pythonPackages.callPackage ./secure-access-token-authorizer.nix { } diff --git a/overlays.nix b/overlays.nix new file mode 100644 index 0000000000000000000000000000000000000000..12280b9138ed4ff09550cadac518ef8668e639de --- /dev/null +++ b/overlays.nix @@ -0,0 +1,17 @@ +self: super: { + python = super.python.override { + packageOverrides = python-self: python-super: { + # new tahoe-lafs dependency + eliot = pkgs.pythonPackages.callPackage ./eliot.nix { }; + # new autobahn requires a newer cryptography + cryptography = pkgs.pythonPackages.callPackage ./cryptography.nix { }; + # new tahoe-lafs depends on a very recent autobahn for better + # websocket testing features. + autobahn = pkgs.pythonPackages.callPackage ./autobahn.nix { }; + + # tahoe-lafs in nixpkgs is packaged as an application! so we have to + # re-package it ourselves as a library. + tahoe-lafs = pkgs.pythonPackages.callPackage ./tahoe-lafs.nix { }; + }; + }; +} diff --git a/secure-access-token-authorizer.nix b/secure-access-token-authorizer.nix index 65de5cd57f7a23770de625d471abd7108c76e7a3..e3dda5a536b714e2daea9edf6304be8a5b453a06 100644 --- a/secure-access-token-authorizer.nix +++ b/secure-access-token-authorizer.nix @@ -1,4 +1,4 @@ -{ buildPythonPackage, sphinx, circleci-cli, pythonPackages, tahoe-lafs }: +{ buildPythonPackage, sphinx, circleci-cli, pythonPackages }: buildPythonPackage rec { version = "0.0"; name = "secure-access-token-authorizer-${version}"; diff --git a/tahoe-lafs.nix b/tahoe-lafs.nix index da0f4e6c8f1d6a9de490dbd6c9e8ccbb1296c259..f5a1ff651a9c522467c10e94170b414220ed286e 100644 --- a/tahoe-lafs.nix +++ b/tahoe-lafs.nix @@ -1,8 +1,14 @@ -{ nettools, pythonPackages, buildPythonPackage, eliot }: +{ fetchFromGitHub, nettools, pythonPackages, buildPythonPackage, eliot, autobahn }: buildPythonPackage rec { version = "1.14.0.dev"; name = "tahoe-lafs-${version}"; - src = ~/Work/python/tahoe-lafs; + src = fetchFromGitHub { + owner = "tahoe-lafs"; + repo = "tahoe-lafs"; + # HEAD of integration/storage-economics branch as of July 15th 2019. + rev = "48bd16a8d9109910122cc2e2c85eb4f378390135"; + sha256 = "0i8k7zb4381vbblriciz1m33va0mxld6nrhpwvjqr9jk335b1a9q"; + }; postPatch = '' sed -i "src/allmydata/util/iputil.py" \ @@ -21,7 +27,7 @@ buildPythonPackage rec { propagatedBuildInputs = with pythonPackages; [ - twisted foolscap nevow simplejson zfec pycryptopp darcsver + twisted autobahn foolscap nevow simplejson zfec pycryptopp darcsver setuptoolsTrial setuptoolsDarcs pycrypto pyasn1 zope_interface service-identity pyyaml magic-wormhole treq appdirs