Live data from Hacker News

What is Nix and why you should try it

yakking.branchable.com

81–90 of 201 posts

Re: What is Nix and why you should try it

#81

Sounds like a similar solution to gentoo's slotted ebuilds [0]. Switching the 'default' implementation system wide or per user (eselect) has the same issues discussed. Not sure if there is an existing utility (beyond your standard shell script) that can produce sane per-shell environments. 0. https://devmanual.gentoo.org/general-concepts/slotting/index...

Mhm, doesn't sound all that similar to me. This looks like something that needs to be maintained on a per-package basis as a fairly ad-hoc solution for different library versions, in Nix the whole thing just falls out of the way it's set up in general.

Re: What is Nix and why you should try it

#82
post #54
post #6

Earlier quoted context omitted.

I think biggest ones are i) nix command is a bit complex, but it's getting redesigned [1] & ii) nixpkg definitions sometimes contain a lot of cruft. I've found Guix and GuixSD, which are a GNU-blessed Guile Scheme-based reimplementation of Nix and NixOS, more aesthetically pleasing. Quite simple and elegant in fact. The major differences are that Guix DSLs are implemented on top of Scheme, whereas Nix uses a custom D…

When will the redesign be merged? It's over a year that I first read about Nix and they talked about the redesign.

The redesign is merged and available via `nix-shell -p nixUnstable`. It isn't so much an issue of merging, but calling the new version stable. We're working on it. No definite timetable though.

Re: What is Nix and why you should try it

#83
post #65
post #3

On my macOS work machine, Nix has replaced Homebrew. The ability to switch between generations of your system state [1] when a new install goes awry is underrated, IMO. [1] https://nixos.org/nix/manual/#sec-profiles

Why not both? Does Homebrew conflict with Nix in such a way that only one is possible at a time? I can definitely see giving Nix priority for work-related development, but I would like to know if Homebrew can still fill in as a backup option.

I've installed both without issue. It might be a headache long-term because of libs and installing things in both systems, etc. Just make sure you know which comes first in PATH.

Re: What is Nix and why you should try it

#84
post #75

Is there a way to install nix into home folder (suppose I don't have sudo on server). I spend some time recently trying to setup nix in such environment and failed. I ended up compiling recent versions of neovim and tmux myself.

Your best bet is proot or a user+mnt namespace.

Re: What is Nix and why you should try it

#85
post #72
post #19

I can vouch for the immense improvement Nix has made to my software development process. I use NixOS on my desktop and laptop. At the OS-level, it gets a lot of things right: reproducible, immutable system configs; lightweight containers; devops with declarative configs. At a software project level, nix-shell is an indispensible tool. Compilers and interpreters aren't even part of my system-wide config; instead each…

By reading your comment and a little bit of the package declarations in some nix packages, it seems like the software package system of nix is very similar to rez. Rez ( https://github.com/nerdvegas/rez ) is used by some visual effects companies (including mine) to manage software packages. It allows us to have great flexibility in the mix & match of software versions and runtime environments.

Does rez handle having an environment with two apps in it that require differing versions of the same dependency?

Re: What is Nix and why you should try it

#86
post #75

Is there a way to install nix into home folder (suppose I don't have sudo on server). I spend some time recently trying to setup nix in such environment and failed. I ended up compiling recent versions of neovim and tmux myself.

Yes and no (mostly yes). Ideally, you have /nix/ where everything gets installed, then folders with symlinks in your homedir (one that builds your workspaces and another that versions them) with an environment variable in your bash_rc to hook you in.

You can put that /nix folder anywhere, but you can no longer use their binary package caches and it will recompile everything. This is because they hard-code paths for dependencies during build time.

Re: What is Nix and why you should try it

#88
post #79

Earlier quoted context omitted.

There are efforts to get deterministic builds in NixOS, but it comes with downsides like very high build times.

Can you elaborate? I always thought deterministic builds would enable faster builds (because it would basically allow for downloading and verification of binaries).

Nix already does binary substitution. It just has the assumption baked in that builds don't do anything nondeterministic (and the Nix build sandbox removes a lot, but not all, of those opportunities; the ones remaining are things like threads, hence the slowdown).

Re: What is Nix and why you should try it

#89
post #19

I can vouch for the immense improvement Nix has made to my software development process. I use NixOS on my desktop and laptop. At the OS-level, it gets a lot of things right: reproducible, immutable system configs; lightweight containers; devops with declarative configs. At a software project level, nix-shell is an indispensible tool. Compilers and interpreters aren't even part of my system-wide config; instead each…

To me, when i look at new distro, i look for how well the repo covers binary packages, i have no time/resource to build compilers/big projects. Last time i checked nix, there aren't that many packages in repo to be usable on laptop.

But the package manager itself might be a good idea for dev environments, but all the languages i use provide similar facility(not counting system-library dependencies).

Re: What is Nix and why you should try it

#90

So, it's like virtualenv, but for all software and not just Python?

Kind of. You can version your workspace, too. Updates are basically atomic. You build the new workspace (with updated versions), then under the hood it just moves a symlink to the new version.

It's got some clever fundamentals that allow for really cool (and clean) features because of it.

Post reply on HN