{ pkgs ? import {}, shell ? false }: let python = let packageOverrides = self: super: { mysqlclient = super.mysqlclient.overridePythonAttrs(old: rec { version = "1.4.6"; src = super.fetchPypi { pname = old.pname; inherit version; sha256 = "f3fdaa9a38752a3b214a6fe79d7cae3653731a53e577821f9187e67cbecb2e16"; }; }); }; in pkgs.python2.override { inherit packageOverrides; self = python; }; pyenv = pypkgs: with pypkgs; [ greenlet twisted cython mysqlclient bcrypt ]; buildInputs = [ (python.withPackages pyenv) ]; in if shell then pkgs.mkShell { inherit buildInputs; } else pkgs.stdenv.mkDerivation { name = "marmots"; src = ./.; inherit buildInputs; installPhase = '' mkdir $out cp -R * $out ''; }