Lin Jian

Results 39 comments of Lin Jian
trafficstars

Thanks @wucke13. I tried you suggestion, but it still doesn't work.

@ryanswrt thanks for the tip. Actually I do manage to get pytorch with cuda working using the pip provider on nixos with `LD_LIBRARY_PATH=/run/opengl-driver/lib ./result/bin/python`. [This example program](https://github.com/pytorch/examples/blob/main/mnist/main.py) works. Maybe because...

> While it works with most session variables, it breaks home.sessionPath that modifies PATH. > It breaks, because zshenv is loaded first and subsequent PATH modifications (like Nix loading) override...

> nix.sh is sourced after zshenv and it overrides PATH. Since session vars are only sourced once, nix.sh's override stays in effect. So you use nix on a foreign system...

> That's exactly the problem: they are sourced too early and only once. No, they are two different situation. The example .zshenv you quote says .zshenv should not contain `PATH`...

Do you have system leval `programs.zsh.enable` enabled?

Please enable that and set-environment will be sourced in /etc/zshenv, which is the right way for zsh. see https://github.com/nix-community/home-manager/issues/2751#issuecomment-1048682643

I think a mention in the manual and release note will help. Will you make a PR for that?

> I wonder if that's going to work on Mac though As long as mac's `/etc/{zprofile,zshrc}` are sane, i.e. not removing items from `PATH`, it should be ok.