I am very new to Nix(OS) and even rather new to Linux, but I am eager to learn. It feels kind of bad to ask a “… does not work” question, but you have to start at some point.
So I just installed Tex Live on my NixOS 20.09 machine by simply adding texlive.combined.scheme-full into my configuration.nix. Unfortunately, the texdoc utility does not seem to work correctly. When I run e.g. texdoc tex, I get
$ texdoc tex`
texdoc error: No texlive.tlpdb nor shipped tlpdb data found.
The NixOS wiki page TexLive - NixOS Wiki doesn’t mention anything helpful. Maybe you know what is the issue?
I did some more research, but so far I cannot figure it out. I hope someone is willing to help a newbie out here. So I found some more documentation in the Nixpkgs manual: NixOS - Nixpkgs 21.05 manual
There it says:
For basic usage just pull texlive.combined.scheme-basic for an environment with basic LaTeX support.
So I think what I did by adding
environment.systemPackages = with pkgs; [
... texlive.combined.scheme-full
];
to my configuration.nix was this “basic usage” (except for using the full scheme instead of basic). Reading on in the Nixpkgs manual:
By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add pkgFilter function to combine:
texlive.combine {
# inherit (texlive) whatever-you-want;
pkgFilter = pkg:
pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "cm-super";
# elem tlType [ "run" "bin" "doc" "source" ]
# there are also other attributes: version, name
}
So guessing around a little, I come to think that adding
somewhere should perhaps install the documentation (and everything else). The problem is, I don’t know where this code must be added. I think what I want to do here is “customizing a package” as described in the NixOS manual: NixOS - NixOS 21.05 manual
Unfortunately, the explanation given there is a little bit too terse for me, and the analogy between my code-snippet and the emacs-examples given there is not strong enough to be entirely clear to me.
texlive.combine is a function that takes an attribute set, as you have your examples above. It will return a derivation containing the modified package.
So you place it in your systemPackages, your shells or derivations buildInputs or whereever else you can put a derivation.
thank you so much for your reply! After realizing that in my above post I added some syntax mistakes when modifying the sample texlive-combine function (a = in the first line, a ; in the last line and a missing " around source), I now have the following in my configuration.nix:
$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: stack overflow (possible infinite recursion)
So I suppose I still got something wrong. Maybe you can spot where my mistake is? Also, be assured that I will continue to read the manuals and familiarize myself with the Nix language, but it would be nice to already use a NixOS machine in practice in parallel.