How to work with broken jupyterhub package/service

I have recently came back to nixos and I am currently trying to configure a server with jupyterhub. But it has been marked as broken due to incompatibility with sqlalchemy in this commit.

Hence, there is are few problems to tackle. As the supported version of sqlalchemy is no longer available in nixpkgs (<2.0) and then we have to force this older version to the jupyterhub package.

I have found this article and found this hash of older version of the jupyterhub package (link). But unfortunately I couldn’t make it work.

I am still very new to the nix and its concepts. How should I tackle this problem? Did some of you had some similar problem? How did you solve it?

Unfortunately I don’t have the code snippets of my experimentations but the last one. I have copied the contents of the last appliable sqlalchemy derivation. and tried to apply it as follows:

{ pkgs, builtins, ... }: {
  services.jupyterhub = let
    alteredJupyterhub = pkgs.python310Packages.jupyterhub.override {
      sqlalchemy = import ../derivations/sqlalchemy.nix; # the last appliable version
    };
  in {
    enable = true;
    stateDirectory = "/data/jupyter";
    jupyterlabEnv = pkgs.python3.withPackages [
      alteredJupyterhub
    ];
  };
}

Will be resolved via

2 Likes

Oh sweet! Thanks for the info. But still, what is the correct solution for such a problem?

Another solution is to have the package outside of python3Packages and use packageOverrides eg nixpkgs/pkgs/servers/web-apps/healthchecks/default.nix at 1c851e8c92b76a00ce84167984a7ec7ba2b1f29c · NixOS/nixpkgs · GitHub