Earlier quoted context omitted.
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…
> 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.
Tvix – A New Implementation of Nix
101–107 of 107 posts
Re: Tvix – A New Implementation of Nix
#102Earlier quoted context omitted.
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 EXTEN…
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.
devenv.sh autogenerates Nix specifications of container images for each of the development environments you define with it, and exposes them in a Nix flake for you. But if you don't explicitly ask Nix to build those for you, it doesn't.
My team's most complex devenv environment passes through some packages from Nixpkgs, exposing them in the flake, defines 3 or 4 development environments ('devShells') and also exposed (and includes in some of those devShells) some custom packages that just live in that repo and not in Nixpkgs.
Our simplest just uses all built-ins and defaults, exposes no packages, doesn't have a custom flake... there's basically nothing to it. It just uses devenv/Nixpkgs built-ins to add OpenTofu with some Terraform plugins to the path and plugs a Terraform linter into the project's pre-commit hooks.
There is some support for running long-lived processes via process-compose, which is inspired by docker-compose, but we don't yet need it for anything so we don't use it. (In the past I've rolled my own solution for this with Nix, direnv, and supervisord. Today I'd probably just use devenv.)
What I love about devenv is how cleanly it integrates with the wider Nix ecosystem in a no-nonsense way, as well as its great docs. I like that it
- it uses the Nix module system for configuration, based on a standard implementation (flake-parts) shared by other projects
- what it builds in, i.e., pre-commit hooks integration, exists in a separate repo also usable on its own via flake-parts
- the docs and the tool both support flakes-based setups, non-flakes setups
- if you want to let devenv automagically set up a flake for you, you can, but you can also use most of its features with a handwritten flake.nix customized to your liking
- while it exposes some configuration via yaml for simple uses, the full power of Nix is always available
- it takes care of all the little details you'd have to deal with if rolling your own (e.g., garbage collection, direnv integration) in a sensible way
For me, as a Nix user, it does a good job of keeping simple use cases simple, it has low lock-in, it uses familiar configuration interfaces, and it doesn't have too much magic.I hope that helps you get a sense of what using devenv is like for simple use cases as well as what the more complex stuff might look like!
Re: Tvix – A New Implementation of Nix
#103Earlier quoted context omitted.
I know full well what OCI is. (Hint: it's a transparent attempt to be a NOT-docker and avoid infringing on whatever Docker Inc.'s latest monetization scheme is.) Using this for what Nix is doing is absolute madness. Docker is madness in general, but dragging it into Nix's core is madness cubed.
"why yes, the open-source Apache-licensed implementation controlled by the linux foundation is just as commercial as the commercial thing! i'm so contrary and interesting!" if you don't want docker-contributed code, here are some alternative implementations of the spec: https://github.com/opencontainers/runtime-spec/blob/main/imp... I believe nix could use one of these with some volunteer effort? Perhaps you could ev…
Re: Tvix – A New Implementation of Nix
#104Does 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?
(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.)
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
Re: Tvix – A New Implementation of Nix
#105Earlier quoted context omitted.
(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.)
[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
Re: Tvix – A New Implementation of Nix
#106Does 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.
Re: Tvix – A New Implementation of Nix
#107Earlier quoted context omitted.
I know full well what OCI is. (Hint: it's a transparent attempt to be a NOT-docker and avoid infringing on whatever Docker Inc.'s latest monetization scheme is.) Using this for what Nix is doing is absolute madness. Docker is madness in general, but dragging it into Nix's core is madness cubed.
"why yes, the open-source Apache-licensed implementation controlled by the linux foundation is just as commercial as the commercial thing! i'm so contrary and interesting!" if you don't want docker-contributed code, here are some alternative implementations of the spec: https://github.com/opencontainers/runtime-spec/blob/main/imp... I believe nix could use one of these with some volunteer effort? Perhaps you could ev…
It is an attempt at an open-source "just good enough" Docker clone.
You understand the difference?