Skip to content
Snippets Groups Projects
new.nix 1.87 KiB
Newer Older
  • Learn to ignore specific revisions
  • Tom Prince's avatar
    Tom Prince committed
    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; }
    
    Tom Prince's avatar
    Tom Prince committed
    , tahoe-lafs-repo ? sources.tahoe-lafs
    
    Tom Prince's avatar
    Tom Prince committed
    }:
    
    Tom Prince's avatar
    Tom Prince committed
      let
        providers = {
          _default = "sdist,nixpkgs,wheel";
    
    Tom Prince's avatar
    Tom Prince committed
          tahoe-lafs = "nixpkgs";
    
    Tom Prince's avatar
    Tom Prince committed
          # 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
          # - missing build dependencies
          platformdirs = "wheel";
          boltons = "wheel";
          klein = "wheel";
          humanize = "wheel";
          chardet = "wheel";
          urllib3 = "wheel";
          zipp = "wheel";
        };
    
    Tom Prince's avatar
    Tom Prince committed
        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.
    
    Tom Prince's avatar
    Tom Prince committed
    
    
    Tom Prince's avatar
    Tom Prince committed
            verstr = "$version"
            __version__ = verstr
            EOF
          '';
    
    Tom Prince's avatar
    Tom Prince committed
          src = tahoe-lafs-repo;
    
    Tom Prince's avatar
    Tom Prince committed
        };
      in
    
    Tom Prince's avatar
    Tom Prince committed
        mach-nix.buildPythonApplication rec {
          python = "python27";
          name = "zero-knowledge-access-pass-authorizer";
          src = ./.;
          inherit providers;
    
    Tom Prince's avatar
    Tom Prince committed
          requirements = builtins.readFile ./requirements/base.txt;
          overridesPre = [
            (
              self: super: {
                inherit tahoe-lafs;
              }
            )
          ];
    
    Tom Prince's avatar
    Tom Prince committed
          format = "setuptools";
          # Record some settings here, so downstream nix files can consume them.
          meta.mach-nix = { inherit python providers; };
        }