News for hackers. Stuff that matters.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by qbasic_forever on Saturday August 12, 2023 @09:56PM (#37105920)
It's no lighter than a process running in docker, on a Linux machine at least. With docker you have a whole root filesystem packaged up and a process inside it is executed on your system with certain kernel namespacing to set its root filesystem, users, network access, limits on memory and CPU usage, etc.

With nix instead of a tarball being the root filesystem it's a bunch of symlinks to stuff in the nix store directory--the process you run is exactly the same as whatever you're running in docker.

One crucial difference is that nix does nothing for network isolation, you have to do all that on your own (if you need it).

Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by Filligree on Saturday August 12, 2023 @10:27PM (#37106093)
Nix doesn't do network, PID or filesystem isolation.

That's a feature. I don't normally want any of those.

Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by qbasic_forever on Saturday August 12, 2023 @10:39PM (#37106160)
You don't have to use them, docker has flags to disable things like network isolation. If you want to go deeper systemd-nspawn doesn't isolate anything (network, pid, user, filesystem, etc.). And if you are some anti-systemd zealot the plain old chroot command does what you want too (and has done so for decades).
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by wtetzner on Monday August 14, 2023 @03:02PM (#37125302)
Except none of those solutions are package managers, are they? The thing that's nice about nix is that you can just specify which packages you want by name, and easily get them in your path.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by midchildan on Sunday August 13, 2023 @02:21PM (#37112606)
My thoughts exactly. Container-based development environments has a Cygwin-like clunkiness to it. But even clunkier because of the default lack of access to the host system, and the additional burden of having to manage multiple containers.

Just to be clear, Cygwin is a great project. But it's not something I'd actively choose over a native Linux system if I had the choice of operating systems.

Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by pkulak on Sunday August 13, 2023 @01:31AM (#37106969)
It’s a lot lighter in terms of disk space. Yes, drives are cheap, but even so, bringing in a different version of debian-slim for every executable gets bloaty. I routinely reclaim 10s (sometimes 100s) of gigs with a podman system reset.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by kaba0 on Sunday August 13, 2023 @03:47AM (#37107611)
Also in RAM. You don’t want to runa whole-ass container for `ls`.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by qbasic_forever on Sunday August 13, 2023 @12:06PM (#37111178)
No a process running in docker or on your host is going to use the same amount of RAM. There is no RAM dedicated to a running container on Linux--it's just a process that's flagged with some metadata to tell the kernel that it should be isolated in certain ways, like with a unique root filesystem.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by kaba0 on Sunday August 13, 2023 @12:17PM (#37111298)
Loading in the whole container though does increase the necessary RAM — with nix, two versions of the same executable can link to the same hash, but it is unlikely to be the case with Docker.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by qbasic_forever on Sunday August 13, 2023 @03:01PM (#37113038)
Your kernel is fine at managing the container root filesystem and paging in and out parts as necessary. It's not just loading gigabytes of root fs into memory and calling it good.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by Filligree on Sunday August 13, 2023 @08:51PM (#37116228)
Files still take up space on disk.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by wtetzner on Sunday August 13, 2023 @09:24PM (#37116404)
Paging still has a cost.
Re:NixOS RFC 136 approved: A plan to stabilize the new CLI a... by wtetzner on Sunday August 13, 2023 @04:34PM (#37114158)
By lighter-weight, I simply mean conceptually, not necessarily computationally.