Skip to content

Using python.withPackages with nixpkgs-overlays does not work #26487

@knedlsepp

Description

@knedlsepp

Issue description

I'm currently trying to make python.withPackages work with some custom overlays, but can't find to make it work.

Steps to reproduce

~/.config/nixpkgs/overlays/test.nix

self: super: with self;
{
  pythonPackages = super.pythonPackages.override {
    overrides = self: super: {
      my_stuff = pythonPackages.buildPythonPackage rec {
        pname = "pyaes";
        version = "1.6.0";
        name = "${pname}-${version}";
        src = pythonPackages.fetchPypi {
          inherit pname version;
          sha256 = "0bp9bjqy1n6ij1zb86wz9lqa1dhla8qr1d7w2kxyn7jbj56sbmcw";
        };
      };
    };
  };
  my_stuff = pythonPackages.buildPythonPackage rec {
    pname = "pyaes";
    version = "1.6.0";
    name = "${pname}-${version}";
    src = pythonPackages.fetchPypi {
      inherit pname version;
      sha256 = "0bp9bjqy1n6ij1zb86wz9lqa1dhla8qr1d7w2kxyn7jbj56sbmcw";
    };
  };
}
nix-shell -p 'python.withPackages(ps: [ps.my_stuff])'

gives

error: attribute ‘my_stuff’ missing, at (string):1:91
(use ‘--show-trace’ to show detailed location information)

whereas nix-shell -p my_stuff works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions