News for hackers. Stuff that matters.
Re:How to Learn Nix by nvarsj on Monday November 22, 2021 @05:18AM (#29304840)
Just to say, there are always ways to deal with what you describe. For /bin/bash, create a symlink from /bin/bash to bash:

  system.activationScripts.binbash = ''
    mkdir -m 0755 -p /bin
    ln -sfn ${pkgs.bash}/bin/bash /bin/.bash.tmp
    mv /bin/.bash.tmp /bin/bash # atomically replace /bin/bash
  '';
For python, you're best off using a virtualenv anyways. For proprietary binaries, you can almost always get them to run using steam-run. But the nicer way is a wrapper script to set up LD_LIBRARY_PATH, or custom derivation to patch their ld lib paths.

Yeah it requires some elbow grease sometimes, but what distribution doesn't? Maybe Fedora/Ubuntu? I think the pain really is all that prior Linux knowledge is non-transferable and you have to learn how to fix things in the Nix way.

Re:How to Learn Nix by alufers on Monday November 22, 2021 @09:56AM (#29306904)
> wrapper script to set up LD_LIBRARY_PATH, or custom derivation to patch their ld lib paths.

There is your problem, I don't want to spend time writing wrapper scripts, or researching how to craft my buildFHS for every little piece of software I will run once for an oddly specific purpose.

Running the proprietary VPN on Arch Linux was as simple as running debtap, and then installing the package via pacman, even though the package shipped by the vendor was made for Ubuntu. It even figured out the dependencies automatically.

I know I could do the same thing on NixOS, but it would be way more clunky and time consuming. For example: this is how a package is installed from a .deb using nix: https://github.com/NixOS/nixpkgs/blob/nixos-19.09/pkgs/tools...

If Arch can do it in two commands, so should NixOS, just with two lines of nix :)

Re:How to Learn Nix by whateveracct on Monday November 22, 2021 @01:13PM (#29309711)
It could probably be automated more. It's just that most NixOS users have low interest in automation .deb -> Nix conversion since it's not something you actually run into often as a NixOS user.
Re:How to Learn Nix by pxc on Monday November 22, 2021 @12:30PM (#29309059)
Check out envfs, which automagically puts symlinks like that in place for you in a systematic way!

https://github.com/Mic92/envfs

Re:How to Learn Nix by seniorivn on Monday November 22, 2021 @06:15AM (#29305180)
you should not create such an imperative simlink almost anything can be packages with nix in a minute or two, so any code you found out the internet would be easy to run and it will take not much more time than to simply check it's build config for malicious code, which you should do anyway
Re:How to Learn Nix by YuukiRey on Monday November 22, 2021 @07:38AM (#29305701)
Maybe if you use buildUserFHS and --impure a lot. But NodeJS applications that try to download binaries at install time or python packages with conflicting package versions definitely take more than a minute or two. Just look at the history of Anki in Nixpkgs, or the derivations for JetBrains products or Cypress or any of the other packages that took consistent effort by multiple contributors to even get them working in the first place.

I think it's important to manage expectations about Nix and that includes being realistic about what's easy and simple what isn't.

Re:How to Learn Nix by nvarsj on Monday November 22, 2021 @10:45AM (#29307605)
Yeah, I am aware what I did above would make a lot of nixos purists shudder. But from a pragmatic pov it saves me a lot of time. It's mostly to deal with repos at clients that are filled with scripts hardcoded to /bin/bash.