Hacker News new | past | comments | ask | show | jobs | submit login

> I would also like it if the language itself can be decoupled from the build and package manager system

I would also like that, but for the exact opposing reason. I love the concepts of nix/guix but i can't stand the dynamic languages with cryptic error messages.




It is a pain but it is manageable with practice. Also the error messages on Nix 2.4 are a lot better and can show the location of errors which is enough 90% of the time.


Can't wait to try out nix 2.4 then, whenever it's deemed compatible with NixOS.


Nix 2.4 is totally compatible with NixOS. It was held back from default status on the latest NixOS release because it includes a few behavior changes to the CLI that have been jarring for some users. It's to ease the transition for them, not because it's broken or something like that.

You can set up Nix 2.4 on NixOS 21.11 by adding

  nix.package = pkgs.nix_2_4;
in your configuration.nix :)

I like the new CLI, too, and it's worth trying if you want to see what all is new in Nix. Here's how to enable flakes on NixOS, if you have Nix 2.4:

  nix.extraOptions = ''
    experimental-features = nix-command flakes
  '';


Thanks for the information! I've heard about flakes but i failed to understand the usefulness of them... from what i gather it's a very heated topic in the nix community which seems to be splitting the ecosystem. Can you recommend in-depth resources about the pros and cons of both approaches from a critical perspective?


There are some technical objections to the design of flakes, but the controversy in the community is primarily social imo.

The reading I'd recommend as someone sympathetic to both 'sides' isn't really a technical comparison, but this: https://grahamc.com/blog/flakes-are-an-obviously-good-thing

As far as technical pros and cons, it's worth looking at colemickens' PoC demonstrating that in principle, you can use Nix to generate literally identical output with and without flakes: https://github.com/colemickens/nixos-flake-example

> Both approaches

it's also worth noting that prior to flakes, there was no single alternative approach to the main problems flakes aims to solve. There were (and are) a whole bunch of competing and bespoke practices for pinning nixpkgs and other Nix sources. You can take a look at niv and nix-thunk to get a sense of them if you want


It has been released. The 20.11 release contains both a nix_2_3 and a nix_2_4 package. I'm fairly certain the only reason 20.11 defaults to 2.3 is because the development of 2.4 focused a lot on flakes despite the fact that there are still an 'experimental' feature (experimental like Gmail was a beta for 7+ years). If you aren't using Nix already there is no reason you can't just start using 2.4 with flakes enabled.


Some other comments in this thread (i have no idea how true they are) suggested there were serious backwards-incompatibilities preventing nix2.4 from being default in the last NixOS release.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: