Hi.
In my configuration.nix, I have sage installed with some custom python packages.
nixpkgs.config.packageOverrides = rec {
mysage = pkgs.sage.override {
requireSageTests = false;
withDoc = false; # NOT WORKING
extraPythonPackages = ps: with ps; [ pycryptodomex lxml ];
};
};
I would like for it NOT to build the docs. As you can see, I tried to disable them, but they are rebuilt every time there is an update to one of the python packages.
Here is what i see with nixos-rebuild switch :
[1/292/304 built, 344 copied (9748.2/9749.6 MiB), 2286.0 MiB DL] building sagedoc-10.0 (buildPhase): [plotting ] <string>:53: UserWarning: The figure layout has changed to tight
Try to find out how your system is depending on sagedoc
nix path-info -r /run/current-system | grep sage
if it does not appear there then nix path-info -r /run/current-system --derivation | grep sage
then once you have the path
do nix why-depends /run/current-system "storepathhere" --all --precise
if the store path ends in .drv then add --derivation to the end
Anyway, looks like you’re just explicitly installing it with environment.systemPackages. So trying the obvious: Are you actually using your mysage? Not sure if this is a copy/paste error, but I’m fairly sure your packageOverrides is broken, since it’s supposed to have a function argument: Nixpkgs 23.05 manual | Nix & NixOS
Hence I wonder if your code ever actually executes. I’m also not sure if packageOverrides will actually apply correctly when used in configuration.nix, it’s only documented for user configuration, you should really be using the nixpkgs.overlays option in configuration.nix.
Even if packageOverrides actually does work when used like this, do you actually use the mysage attribute or are you under the rather common misconception that sage will have been changed to your mysage attribute?
And I just tried this with a more normal overlay, and confirmed that it even happens with mysage as the defacto attribute used. Weirdness of config.packageOverrides aside then, the resulting sage wrapper does indeed not contain the sage docs:
It must be pulled in by some other means, but the sage package is the only direct reference to sagedoc. withDoc is false by default in any case, so the overlay should be having no effect on whether docs are built whatsoever, and indeed it does not, docs are installed whether you use the with-docs package or the without-docs package. Something’s fishy, but I can’t spot the mistake.
They are in the passthru, but that should not be evaluated if it isn’t used?
So adding the package to environment.systemPackages is enough to install the derivation the doc passthru points to, yet the sage derivation does not depend on the derivation in its doc passthru.
It couldn’t possibly be because environment.systemPackages somehow sees the doc attribute from the passthru as one of the outputs, could it?