Live data from Hacker News

Purely Functional Linux with NixOS [video]

begriffs.com

61–70 of 143 posts

Re: Purely Functional Linux with NixOS [video]

#61
post #51

Earlier quoted context omitted.

"From the outside, package management has always seemed to me like a huge mess." Compared to what?! There's no OS that has historically had better (or even close to as good) package management as Linux, either in the form of apt-get/dpkg or yum/RPM. Nix is probably better, on a couple of dimensions, but to suggest it was a mess before...well, I just wonder what you could be comparing to that would be better?

Perhaps it's about expecting to have program locality? I.e. you download a zip file, you unpack it into a directory, and here is your entire program. Right there, in that directory, not splattered around the filesystem by the package manager. That's the way it's done on Windows, anyway.

Perhaps for the newer Windows platforms (e.g. UWP) but Win32 installers have definitely been known to put things all over your system.

Re: Purely Functional Linux with NixOS [video]

#62
post #19
post #9

I think NixOS is the future, but there needs to be more time put into UX. Distros like Ubuntu are still much easier to get running and this scares many people away :/

And it's unusable on small VMs, it takes like almost a gig of ram to install something and lots of time to figure out how to edit some config if it doesn't have an option for your needs. So, yeah, if they want users - they need to work on that.

That's interesting, and not something I'd noticed (I have a 2GB NixOS VM for tinkering with it). That makes NixOS far less attractive for the things I was think it would be a natural for: containers. Because containers need to be reproducible, and because the current crop of container management and deployment tools are really messy, NixOS seems like a natural fit for building containers (maybe for hosting them, too, eventually).

But, if it's not possible to custom build tiny containers on demand without needing a ton of memory, the power of it becomes less fun. I'm visualizing a system whereby you spin up custom environments based on need (with exactly and only the packages and config you need for the specific task, at hand), on demand, in a distributed environment. That'd be harder if the resources to spin up are very high.

apt and yum both can consume a lot of memory when installing large lists of packages, but 1GB is pretty far out, and you can work around it by installing a small number of packages at a time. Which slows it down, but allows installation to work on even very small systems (like 128MB, or even smaller, if you've got a little swap).

Re: Purely Functional Linux with NixOS [video]

#63
post #29

Earlier quoted context omitted.

>Guix is fundamentally opposed to pre-compiled binaries. Nix has no issue with them. Using pre-compiled binaries means that builds aren't reproducible, a goal of both Nix and Guix.

How so? You can see the build as a pure function. It consumes a binary blob but it doesn't make it any less deterministic?

Yes, using binaries is a different issue to software freedom.

For example, the Haskell toolchain in nixpkgs downloads pre-compiled binaries of old GHC versions (7.0.4 and 7.4.2) which it uses to bootstrap the newer versions.

The binaries are checksummed to ensure reproducibility.

Re: Purely Functional Linux with NixOS [video]

#64
post #51

Earlier quoted context omitted.

"From the outside, package management has always seemed to me like a huge mess." Compared to what?! There's no OS that has historically had better (or even close to as good) package management as Linux, either in the form of apt-get/dpkg or yum/RPM. Nix is probably better, on a couple of dimensions, but to suggest it was a mess before...well, I just wonder what you could be comparing to that would be better?

Perhaps it's about expecting to have program locality? I.e. you download a zip file, you unpack it into a directory, and here is your entire program. Right there, in that directory, not splattered around the filesystem by the package manager. That's the way it's done on Windows, anyway.

No, Windows has %ProgramFiles%, %CommonProgramFiles% and the registry as officially supported places to put application data.

Re: Purely Functional Linux with NixOS [video]

#65
post #51

Earlier quoted context omitted.

Perhaps it's about expecting to have program locality? I.e. you download a zip file, you unpack it into a directory, and here is your entire program. Right there, in that directory, not splattered around the filesystem by the package manager. That's the way it's done on Windows, anyway.

Perhaps for the newer Windows platforms (e.g. UWP) but Win32 installers have definitely been known to put things all over your system.

Yeah, that's the reason why i have a "got installer? not worth using" pre-filter for Windows software.

Not sure how things are these days, but i'm talking about the Win 9x to Win 7 days.

Re: Purely Functional Linux with NixOS [video]

#66

Earlier quoted context omitted.

>Guix is fundamentally opposed to pre-compiled binaries. Nix has no issue with them. Using pre-compiled binaries means that builds aren't reproducible, a goal of both Nix and Guix.

That doesn't make sense. A reproducible build means that a build done in two different places results in the same binary. It has nothing to do with whether the vendor distributes binaries (with optional source) or source alone. The binary is what matters. i.g., if I build this package myself, will it result in the exact same binary that I download from the vendor? Binaries can be signed to prove that the chain of tru…

The intent of reproducible builds, as defined by the reproducible builds project[0], is to have the entire dependency tree built from the complete, corresponding source code of the many projects in that tree, starting from a minimal set of "bootstrap binaries"[1]. Using precompiled binaries, without a doubt, invalidates that goal. Reproducible builds are an ongoing, unsolved problem. In Guix, some things are reproducible, some things aren't, but our goal remains to maximize reproducibility.

[0] https://reproducible-builds.org/

[1] https://www.gnu.org/software/guix/manual/html_node/Bootstrap...

Re: Purely Functional Linux with NixOS [video]

#67

Earlier quoted context omitted.

Nix is actually a purely function programming language - you can embed function calls in it. This is used to great effect in various parts of nixpkgs - the entire thing is actually a program which returns the Nix package tree (but is not fully evaluated unless you explicitly ask for it).

OK, I replace my naive question above with a different naive question: "Why not just use Haskell?"

Haskell is honestly a larger language, and is a pain in the butt to write. If you're just writing configuration or a very simple package, Nix is basically "JSON with colons, multiline strings, and function calls". Haskell doesn't have a reasonable built-in syntax for dictionaries/maps/whatever you want to call them, which is 95% of Nix.

Re: Purely Functional Linux with NixOS [video]

#68
post #56

Anyone using NixOS as a server in production? We're on FreeBSD now but I think Linux in our stack is inevitable (many servers, like Aerospike, are Linux only). There's always Ubuntu, but this looks lovely. I've had my eye on it for a personal Linux workstation but haven't heard anything about it as a server.

If you're a non-trivial shop you'll need to harden it, you're better off with CentOS/RHEL than Ubuntu.

Why?

Re: Purely Functional Linux with NixOS [video]

#69
post #39

See also GNU Guix. https://www.gnu.org/software/guix/

In a similar vein is Intel's Clear Linux[0] https://clearlinux.org/

Clear Linux is much more focused on the "containers as VMs" direction than nix or guix are (Use the $PATH instead of containers, no virtualization of network cards etc).

Re: Purely Functional Linux with NixOS [video]

#70
post #51

Earlier quoted context omitted.

"From the outside, package management has always seemed to me like a huge mess." Compared to what?! There's no OS that has historically had better (or even close to as good) package management as Linux, either in the form of apt-get/dpkg or yum/RPM. Nix is probably better, on a couple of dimensions, but to suggest it was a mess before...well, I just wonder what you could be comparing to that would be better?

Perhaps it's about expecting to have program locality? I.e. you download a zip file, you unpack it into a directory, and here is your entire program. Right there, in that directory, not splattered around the filesystem by the package manager. That's the way it's done on Windows, anyway.

Huh. I didn't even consider that. I guess it's been a very long time since I've used systems where that was a thing that happened (and Windows isn't such a system, realistically speaking; Program Files, registry, etc.). But, I do remember coming from Amiga back in 1995, or so, and thinking UNIX/Linux was crazy with things spread all over the place. Amiga did work that way, generally speaking (though it looked a little UNIX-y at the system layer, too). How was I supposed to find anything?

But, the package manager knows where everything is so I don't have to (and there's consistency across systems...system python/perl/ruby/bash is always in /usr/bin).

If that's why "it's a mess", then I have to argue that it only looks like a mess, until you get to know it a little better. Package management is the single biggest reason I have never been able to seriously use any other desktop OS over the past 20 years, or so (I have a Windows partition for games and audio, and I've had a Hackintosh a couple of times for tinkering with iOS dev, but Linux is where I get work done).

Post reply on HN