Readit News logoReadit News
alchemist1e9 · a year ago
Maybe worth mentioning rust and performance more prominently as the motivations.

Is Nix eating the world? We have seen lots of unbelievable projects using it on HN recently. It feels like anyone serious about complex systems and building software are embracing it.

I use it extensively also via nixpkgs, though somehow I have yet to make the leap to full NixOS.

One consideration for anyone who hasn’t jumped in, is that I have nixpkgs on Linux, MacOS, and Win11 hosts. I’ve found that incredibly useful.

lambdaba · a year ago
There's also nix-darwin and home-manager. I barely use brew anymore, not directly anyway, for the rare packages that aren't in nixpkgs.
vvern · a year ago
Can you provide some links to some projects? You’ve piqued my interest
igorramazanov · a year ago
I would not call these projects unbelievable, but they are neat.

Opt-in state:

https://github.com/nix-community/impermanence

https://grahamc.com/blog/erase-your-darlings

Ease of setting up a real-time audio on Linux:

https://github.com/musnix/musnix

Generating virtual machines/installators from a configuration:

https://github.com/astro/microvm.nix

https://github.com/nix-community/nixos-generators

It's interesting to scroll through nix-darwin options, I wasn't even aware of some useful macOS options before:

https://daiderd.com/nix-darwin/manual/index.html

A neat collection of music information retrieval packages in one place (and the ease of creating your own package registry):

https://github.com/carlthome/mirpkgs

alchemist1e9 · a year ago
https://github.com/majbacka-labs/nixos.fi

https://news.ycombinator.com/item?id=40010991

https://news.ycombinator.com/item?id=39720007

https://news.ycombinator.com/item?id=39692801

https://news.ycombinator.com/item?id=39658684

https://news.ycombinator.com/item?id=39004785

I didn’t find these via HN search, I found them in my bookmarking account. I have a slightly strange way of bookmarking - I send emails to a dedicated email account, so these I found there looking for Nix in a search.

NewJazz · a year ago
Tow-Boot comes to mind for me. https://github.com/Tow-Boot/Tow-Boot/

Also plenty of projects here: https://github.com/nix-community/awesome-nix

nurple · a year ago
Not super recent, but nix-snapshotter is one that I'd call awesome(but I'm also a k8s fanboi): https://github.com/pdtpartners/nix-snapshotter

https://news.ycombinator.com/item?id=37407758

Rucadi · a year ago
One useful webpage this project provides is this godbolt for nix:

https://bolt.tvix.dev/

really useful.

tazjin · a year ago
Well, we have the ambition to make it a sort of Godbolt for Nix, but none of us are frontenders and it's not quite as visually impressive and easy to follow as the actual Godbolt. It does work, though!

We've also been thinking about ways to make nixpkgs available there. Adding `lib` at least in some fashion would be quite useful, I think.

mixedCase · a year ago
Does not care about flakes and does not care about adding types, the most important omission in Nix. A minor performance bump seems unlikely to make me want to boil the ocean.
dlahoda · a year ago
nix modules have types. in flakes they can be quasi statically verified
Izmaki · a year ago
For somebody who hasn't used Nix yet, but heard good things about it, why use Tvix instead of Nix? The page didn't seem to mention the reason(s) behind the project.
aidenn0 · a year ago
I would recommend against using Tvix at this time, but if you are wondering why they wrote it, they wrote an article: https://tvl.fyi/blog/rewriting-nix

The goals they list are:

> Creating an alternative implementation of Nix that is fully compatible with nixpkgs.

No explanation needed.

> More efficient Nix language evaluation, leading to greatly increased performance.

The Nix language is evaluated whenever doing the Nix equivalent of installing a package, or rebuilding your configuration. Note that most of the time it's "fast enough" but the authors of Tvix are doing more with the Nix language (which leads into)

> No more strict separation of evaluation and build phases: Generating Nix data structures from build artefacts ("IFD") should be supported first-class and not incur significant performance cost.

and

> Well-defined interaction protocols for how the three different components (evaluator, builder, store) interact.

As it currently works, the Nix language is evaluated to something called a derivation, which is a specific format for defining how to build something (including a list of dependencies). The derivation is then used to actually build the artifact. This is about when you want the metaphorical snake to eat its tail and have the results of a derivation be more nix language to evaluate.

> A builder implementation using OCI instead of custom sandboxing code.

Hermetic builds require some sandboxing; Using OCI containers seems like an obvious choice, but didn't exist when Nix was first created.

TheFuzzball · a year ago
> > A builder implementation using OCI instead of custom sandboxing code.

> Hermetic builds require some sandboxing; Using OCI containers seems like an obvious choice, but didn't exist when Nix was first created.

Presumably this would make this implementation Linux-only, since OCI isn't natively supported outside of Linux?

otabdeveloper4 · a year ago
> A builder implementation using OCI instead of custom sandboxing code.

A complete non-starter, never in a thousand years am I gonna use something that requires a Docker installation for building derivations.

thomastjeffery · a year ago
> us evakyated

huh?

tmountain · a year ago
It looks like they’ve factored out the main features of Nix into modules to allow for more flexibility regarding the implementation details of each underlying service.
RaitoBezarius · a year ago
Not ready, so not a good reason to use it yet.
smasher164 · a year ago
Does tvix support targeting windows? And I do not mean WSL. iirc, the nix attempted a windows port but there were some hardcoded assumptions made about unix in the implementation that made it intractable, for example the location of the store. Do these issues also hold for tvix?
Smaug123 · a year ago
(Nix itself is slowly chugging along with Windows via MinGW - https://discourse.nixos.org/t/nix-on-windows/1113/108 and https://github.com/NixOS/nix/issues/1320 , for example.)
coach__amit · a year ago
[not related to this thread]

working on a project that I'd love to run by you in the men's health space.

came across a comment you made on a previous post, so figured I'd reach out.

amitthakrarcoaching@gmail.com

RaitoBezarius · a year ago
Tvix developer here; we do have Windows in mind. Rust makes a bunch of things easier regarding this, but _not everything_. It's not a priority.

The location of the store is not really the main blocker in those sorts of situations, IMHO.

ingenieroariel · a year ago
I recently learnt about this: https://nlnet.nl/project/libnix/

A project funded by the EU to bring Nix to Windows.

(edit: typo and clarity)

rekoros · a year ago
Looks like the dev team mosly speaks Russian? (Russian is native for me, but I've lived most of my life stateside.)

In Russian, "tvix" is pronounced, roughly, "tweaks" (but with a German - hard "v" - W sound), which to a Russian probably sounds super clever, given what Tvix is (Nix, tweaked).

In English though, how is it pronounced? I'd like to propose "t-f-icks", because it at least sounds like a candy we think the Lebowski nihilists might well have been ordering at a diner.

tazjin · a year ago
Привет) Almost everyone on the team speaks a language where this pronunciation is obvious (most prominently Russian and German, but it also works in e.g. Swedish).

I've noticed when talking to English native speakers that Brits seem to get it right away and say something close to "твикс", whereas Americans almost always say "tee-vix" ("тивикс") and need serious convincing work to switch over to how we say it.

hamandcheese · a year ago
I think the more likely etymology is because it's from The Virus Lounge. Tvix = The Virus Lounge Nix.
aeonik · a year ago
My first thought was Tuvix from Star Trek Voyager.

Expect more like: T-Vix

https://memory-alpha.fandom.com/wiki/Tuvix

tazjin · a year ago
That is the actual etymology, but we're happy to retcon it to something more clever))
tribby · a year ago
I would pronounce it tee-vix, because of the stock ticker symbol TVIX[0] which was a leveraged volatility ETN and very popular in its day. a little too popular - credit suisse delisted it a couple months after the initial market crash brought on by the pandemic caused it to skyrocket

naming is hard :)

0. https://www.thestreet.com/etffocus/market-intelligence/rip-t...

ramses0 · a year ago
"betwixt" => twix => tvix

(kindof like tuh-veeex run together)

...as the candy bar etymology in their logo implies.

jrockway · a year ago
I pronounce it "tiv icks". Remember DIVX?
rekoros · a year ago
That works!
orbital-decay · a year ago
So, how ready is this for general use? Is there anything still missing in the implementation?
RaitoBezarius · a year ago
Tvix developer here; correctness is still not guaranteed, there's nothing to use here except if you already understand well Nix concepts to pick parts and build stuff on the top of it and accept the inherent instability :).
k8svet · a year ago
builtins.fetchTarball is not there, among others, and from watching Matrix I think there are still some things in nixpkgs that eval slightly differently in tvix.

It feels like things are heating up, and "soon" is on the horizon.

codedokode · a year ago
By the way, is there some way to specify dependencies in C? Like requirements.txt in Python, where you put libraries names and versions and the user has to run a single command to install them (and without requiring root privileges)? Is this nix/tvix/guix an equivalent of pip?
ingenieroariel · a year ago
Check out devenv.sh from the Cachix people, it allows you to list stuff like pip for any language, including services / postgresql extensions:

   { pkgs, ... }: {
   services.postgres = {
    enable = true;
    package = pkgs.postgresql_15;
    initialDatabases = [{ name = "mydb"; }];
    extensions = extensions: [
      extensions.postgis
      extensions.timescaledb
    ];
    settings.shared_preload_libraries = "timescaledb";
    initialScript = "CREATE EXTENSION IF NOT EXISTS timescaledb;";
  };
   }

codedokode · a year ago
Interesting, but the word "containers" is scaring me. I wanted just a simple tool to download and install several libraries and not a full Docker/Kubernetes level system...

But it looks like a good choice for running tests in CI.

ingenieroariel · a year ago
One way to wrap your head around it is apt/systemd in a pip-like config file.
rgoulter · a year ago
> is there some way to specify dependencies in C? Like requirements.txt in Python, where you put libraries names and versions and the user has to run a single command to install them (and without requiring root privileges)?

I'd describe this as "(language-specific) package management".

"Requiring root privileges" is more/less equivalent to "packages get installed in a system-wide location".

There are some C or C++ specific package managers.. but, essentially what's missing is the ecosystem/culture for providing a packages for those. -- e.g. With the Rust, packages use Cargo.

> Is this nix/tvix/guix an equivalent of pip?

Nix and guix are system package managers.

Since they're powerful tools, one popular use case is for providing dependencies for C projects.

Nix practically requires root for its installation. (i.e. installing it without root may be possible, but I'd think it's impractical). Although once installed, it can provide packages without needing root.

Cloudef · a year ago
Yes, write either a shell.nix or flake.nix file

https://nixos.wiki/wiki/Development_environment_with_nix-she...

o11c · a year ago
It's possible, just beware that other-distro versions of Nix are pretty aggressive at patching themselves into your shell profiles, which is often undesirable.
diogocp · a year ago
Yes, Nix can do that. Another (simpler IMO) alternative is vcpkg.