Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for listing texlive packages #203

Closed
wants to merge 1 commit into from

Conversation

Mathnerd314
Copy link

@Mathnerd314 Mathnerd314 commented Oct 5, 2020

Fix for issue #202. The packages show up in the nix-env listing, so the Nix part seems fine, but I don't know how to test the Python part as it seems to require setting up elasticsearch.

(and of course it's hacky, but the Texlive packaging scheme is completely different from the rest of nixpkgs...)

@garbas
Copy link
Member

garbas commented Oct 6, 2020

@Mathnerd314 Great work!

I think this would be better to solve in nixpkgs as we do for other package sets. I would assume there would be texlivePackages which we would have to traverse into.

nixos search is already a lot of hacks and a small force is keeping it all together for now. I would hate to add more complexity to it, especially since it would be better to upstream this. What do you think, can you open a PR against nixpkgs and reference this discussion?

@Mathnerd314
Copy link
Author

Mathnerd314 commented Oct 6, 2020

I tried hacking on it, but the texlive code is quite complicated compared to other package sets with the way it filters and groups outputs. I don't think I can open a PR. Maybe @veprbl knows the code better than me...

@veprbl
Copy link
Member

veprbl commented Oct 6, 2020

@Mathnerd314 So expression in the PR doesn't work yet?

@Mathnerd314
Copy link
Author

Well, it works as far as I can test it (for basic packages, not for collections or schemes). But AIUI @garbas is saying he'd rather change nixpkgs than include a workaround in nixos-search. But from poking around, it seems changing paths like texlive.memoir to be stdenv derivations rather than lists would require rewriting a lot of the package filtering logic.

@veprbl
Copy link
Member

veprbl commented Oct 7, 2020

@Mathnerd314 We could move your expression to texlive.__search, but we would still need to somehow do the s/texlive.__search./texlive./ on the path. In any case, I doubt we are going to be able to make texlive.memoir into a real installable package, AFAIK this is not how texlive can work.

@garbas
Copy link
Member

garbas commented Oct 7, 2020

@veprbl I'm not aware how texlive packaging is done, but search.nixos.org will only list installable packages. I assume the situation is similar as with vimPlugins for example or emacsPackages. You can not really use it if you install it but it is still a derivation.

@veprbl
Copy link
Member

veprbl commented Oct 7, 2020

@garbas

search.nixos.org will only list installable packages

Sorry, I'm confused. It currently does search on emacsPackages, but those are not installable.

@garbas
Copy link
Member

garbas commented Oct 7, 2020

@veprbl

search.nixos.org will only list installable packages

Sorry, I'm confused. It currently does search on emacsPackages, but those are not installable.

Sorry for the confusion. I think I to define what installable package is and then discussion will be easier 👍

An installable package is a derivation and has a clear attr path to it.

In case of emacsPackages you can do nix-env -iA nixos.emacsPackages.jeison or nix build nixpkgs#emacsPackages.jeison or nix-build ./path/to/nixpkgs -A emacsPackages.jeison.

In case of texlive I would expect there would be a texlivePackages (or texlive.packages or something similar) to follow a common pattern in nixpkgs. Then one could do nix build nixpkgs#texlivePackages.12many to install a texlive package, like you can do with emacsPackages, pythonPackages, vimPlugins, etc ... I think currently you need to do something like nix build nixpkgs#textlivePackages.12many.0 (where 0 pointing to the first element in the list).

Would it be possible to create texlivePackages?

@veprbl
Copy link
Member

veprbl commented Oct 8, 2020

I guess we could talk about different levels of "installable packages":

  1. Addressable by an attribute path. Unfortunately there isn't much support in Nix tooling for addressing lists. There is also not much reason for the texlive "packages" to be presented by ordered lists, so they might as well have been attrsets with keys like run, doc, source, or even a single derivation with multiple outputs. This is, however, not the current design and changing it would break the backwards compatibility.
  2. Derivations actually working when installed. This might require some modifications to the kpathsea configuration and/or some other patching to make this work.
  3. Derivations pluggable via shellHook. This could require similar framework as for 1. perhaps with some different performance trade-offs.

I'm only sure that 0. is achievable, but personally I am not convinced that it is worth it on its own.

@garbas
Copy link
Member

garbas commented Dec 16, 2020

@veprbl yes, number 0 is what is needed. maybe if this new API is created as texlivePackages and also preserving existing way of having an ordered list. A single derivation with multiple outputs sounds like it would the right way (the most nix way) to do it.

@garbas garbas closed this Dec 18, 2020
@garbas garbas deleted the branch NixOS:master December 18, 2020 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants