I am trying to create an overlay for a python application (octoprint) in which I would like to add my own python package to its own overridden python derivation.
For now I am trying to do that inside a shell.nix
file for easier testing.
Here is my pieced together attempt to do so, but for now it fails due to some syntax errors.
let pkgs = import <nixpkgs> {
overlays = [
(self: super: {
octoprint = super.octoprint.override {
python = super.octoprint.python.override {
packageOverrides = selfPy: superPy: {
octoprint-ldap = selfPy.buildPythonPackage rec {
pname = "OctoPrintPlugin-OctoPrint-LDAP";
version = "1.1.0";
propagatedBuildInputs = [ super.octoprint ];
doCheck = false;
src = pkgs.fetchGit {
url = "https://github.com/gillg/OctoPrint-LDAP.git";
ref = "master";
};
};
};
};
};
})
];
};
in pkgs.mkShell {
nativeBuildInputs = [ pkgs.octoprint ];
}
OctoPrint creates a custom python3 override here which itself switches out some packages for different versions and introduces some new ones (mostly octoprint plugins). Finally it is all put together using the toPythonApplication
call at the bottom of the file.
What I am trying to do is to introduce another plugin to that python derivation.
Is that even possible?
EDIT: Ah, I found that my initial override of octoprint just calls the package expression, which accepts python3
as a parameter. Feels like I am getting closer to a solution.