I have programs.texlive.enable = true; in my home.nix, and this is the error I see:
❯ home-manager switch
these derivations will be built:
/nix/store/wsbp9pxlzqyqzddspc1vsh4ba9vgq7xz-hyphens.sed.drv
/nix/store/qw02akkc0d8rnvz3ss2waj9xpyp6b9qv-texlive-combined-2018.drv
/nix/store/p5j5mk4zbdf30lany3s51x7cpgr45kqb-home-manager-path.drv
/nix/store/4qv0sgxcbfdxg9xj08wyanjv0pavzylq-activation-script.drv
/nix/store/3izil4hylcxmyxyiajjvpr61jpv9qzi6-home-manager-generation.drv
these paths will be fetched (0.01 MiB download, 0.04 MiB unpacked):
/nix/store/8m32b8mla61cqdi0x0201a99kn28d8s8-hook
/nix/store/9qrxkya37d0ajls3yygy0ry268p805v7-stdenv-linux
/nix/store/zh7x10401xchzi6qsg89f69z35sv9di6-hook
copying path '/nix/store/9qrxkya37d0ajls3yygy0ry268p805v7-stdenv-linux' from 'https://cache.nixos.org'...
copying path '/nix/store/zh7x10401xchzi6qsg89f69z35sv9di6-hook' from 'https://cache.nixos.org'...
building '/nix/store/wsbp9pxlzqyqzddspc1vsh4ba9vgq7xz-hyphens.sed.drv'...
copying path '/nix/store/8m32b8mla61cqdi0x0201a99kn28d8s8-hook' from 'https://cache.nixos.org'...
building '/nix/store/qw02akkc0d8rnvz3ss2waj9xpyp6b9qv-texlive-combined-2018.drv'...
created 1 symlinks in user environment
/nix/store/bdf46hk1i9a8q85vvbi8azdbbmmzswiy-stdenv-linux/setup: line 1270: cd: /nix/store/yagm1wpl3jd2qj2mafn9sqcpkfmgc1x9-texlive-combined-2018/share/texmf/scripts/texlive: No such file or directory
builder for '/nix/store/qw02akkc0d8rnvz3ss2waj9xpyp6b9qv-texlive-combined-2018.drv' failed with exit code 1
cannot build derivation '/nix/store/p5j5mk4zbdf30lany3s51x7cpgr45kqb-home-manager-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3izil4hylcxmyxyiajjvpr61jpv9qzi6-home-manager-generation.drv': 1 dependencies couldn't be built
error: build of '/nix/store/3izil4hylcxmyxyiajjvpr61jpv9qzi6-home-manager-generation.drv' failed
And this is what's at that path:
❯ ll /nix/store/yagm1wpl3jd2qj2mafn9sqcpkfmgc1x9-texlive-combined-2018/share/texmf
Permissions Size User Date Modified Name
lrwxrwxrwx 68 nixbld1 3 Jan 20:26 doc -> /nix/store/9i9k6ck4jgiw3kk5g6arqzk71mhi49rf-texlive-bin-2018-doc/doc
❯ nix-channel --list
home-manager https://github.com/rycee/home-manager/archive/release-18.09.tar.gz
nixos-unstable https://nixos.org/channels/nixos-unstable
I should add that running nix-env -iA texlive.combined.scheme-basic worked.
Here is my texlive setup https://github.com/Jomik/dotfiles/blob/master/.config/nixpkgs/home.nix#L81-L96
Which works on nixos-release-18.09 and home-manager master.
I would probably suggest setting home-manager to track master, if you want to track nixos-unstable.
@Jomik I have the nixos-unstable channel only to install specific packages from unstable. The system uses 18.09, so I suppose that's what <nixpkgs> points to and Home Manager would see?
❯ echo $NIX_PATH
/home/asymmetric/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
@asymmetric Try doing nix eval '(import <nixpkgs> { }).lib.version' in your shell as your user, that is what home-manager detects. I.e., in this case it'd be /nix/var/nix/profiles/per-user/root/channels/nixos I'd bet. Which is probably unstable.
For me nix eval '(import <nixpkgs> { }).lib.version' prints "18.09.1829.0396345b794".
Yeah, same version as you, which I guess is 18.09?
Wanna try doing a sudo nixos-rebuild --upgrade switch followed by nix-channel --update and see if it works? Sort of assume you did that already though...
Alternatively, try to use the lines from my dotfiles. Specifically, the scheme extra package.
Ok, seems like it only works if at least something like scheme-basic is included in extraPackages.
So I'm not really sure the extraPackages name is correct, since it's actually necessary to set one of them to make TeX Live work.
Thought so. You need to choose at least a scheme for the NixOS package to work. Yeah.
What do you think, would renaming the attribute to packages help clarify that they're not extra, but required?
Alternatively we could have an attribute called scheme which is required.
But I imagine that there's a subset of packages that would also work, meaning that schemes are not actually required, just very convenient.
Oh, I actually thought they were required to get a functioning texlive. Guess you are right though.
It makes sense to rename it packages, remove the default value (or maybe set default to [ tpkgs.scheme-small ]), and then also assert that the list is non-empty.
Thanks for the thorough examination! I changed the default to include collection-basic, added an assert on requiring at least one extra package, and added a test to verify that installs work with a plain programs.texlive.enable = true; configuration.
Most helpful comment
Thanks for the thorough examination! I changed the default to include
collection-basic, added an assert on requiring at least one extra package, and added a test to verify that installs work with a plainprograms.texlive.enable = true;configuration.