Passing through octave packages to xeus-octave

I have been working on packaging xeus-octave for use with jupyterhub on nixos 25.11, using my own fork of xeus-octave, as the original software depends on the cmake module for glad, which fetches content from some APIs during build time.

So, I was able to get xeus-octave working with the base octave package, but whenever I try to provide additional octave packages using e.g.

octave_with_packages = pkgs.octave.withPackages (ps: with ps; [ strings ]);

the new package will build, and if I add that octave package to my environment.systemPackages then I am able to load the package into the octave environment. However, if I use that octave package to build xeus-octave, the xeus-octave jupyter environment cannot find the octave package.

For example, if we use this system configuration and run octave-cli, we can see the strings package is installed:

[tnu@valerian:~]$ octave-cli
GNU Octave, version 10.3.0
Copyright (C) 1993-2025 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Home page:            https://octave.org
Support resources:    https://octave.org/support
Improve Octave:       https://octave.org/get-involved

For changes from previous versions, type 'news'.

octave:1> pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     strings  |   1.3.1 | .../share/octave/octave_packages/strings-1.3.1
octave:2>

However, if we use the same config, and run it in the installed jupyterhub, pkg list says there are no packages installed.

I think this has something to do with how the regular octave executable is wrapped; however, I am not sure how I would go about wrapping xeus-octave in a similar way.

1 Like