this post was submitted on 03 Jul 2025
177 points (96.3% liked)

Linux

56192 readers
844 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] chaospatterns@lemmy.world 7 points 5 days ago* (last edited 5 days ago)

I really want to like Nix. The idea of declaratively defining my entire system sounds great. I can manage it with Git and even have multiple machines all look the same. I can define my partititioning once and magically get a btrfs disk working. Wow!

But I find the language confusing no matter how many times people say it's easy. I have a lot of experience with other programming languages so maybe it just doesn't mesh. It also gives terrible error messages that are hard for me to understand. And Nixpkgs is unpredictable for what version I'm going to get. One of the services I installed ended up being a release candidate version which was a surprise. What if I don't want the latest version of Docker? How do I pin it? Do I have to duplicate part of Nixpkgs? It just feels like a monorepo where everybody has to be on the same versions. Why on earth do the Nix language docs start by introducing math expressions instead of here is a simple self contained thing that installs one program. Here's how you configure it. Here's how you expand. Why does the dependency graph seem to pull in so many unnecessary dependencies? For example, I tried to build a minimal Docker image (which Nix looks to be a very good fit for), but I couldn't figure out how to strip out dependencies that likely were only used during build for a dependency.

I still like the idea and have managed to get my server defined entirely with NixOS which is very cool, but I can't recommend this to my tech friends because if I'm confused they will be more so.

[–] msherburn33@lemmy.ml 10 points 6 days ago (2 children)

The Nix language itself is the hardest part.

Let me disagree there, the language is trivial. It's just JSON-lookalike with expressions, with a lot of nice touches that make using it much easier than all the alternatives (e.g. sane multi-line string handling, lazy evaluation, default values, powerful key/value sets, etc.). The only real stumbling for me when first encountering it was realizing that functions can only take a single argument (which can be a key/value set) and that functions are literally just : (e.g. (a: a + 5) 6 => 11). That's easily missed if you just look at a file without reading the documentation.

The thing that makes it hard is just the complexity of the actual package collection, your configuration contains literally your whole system, and it's not always obvious where to find the thing you need, since sometimes it's a plain package, sometimes it is a services.foobar.enable = true and sometimes you have to fiddle with override or other package specific things. Knowing that https://search.nixos.org/ exists is half the battle here.

There is also the lack of static typing that can lead to rather verbose error messages, but it's not like many other configuration formats have that either.

[–] heraplem@leminal.space 5 points 6 days ago* (last edited 6 days ago)

There are a few gnarly things about Nix, even for someone who's familiar with Haskell (the most similar language to Nix that's even close to mainstream).

  • Dynamic typing (you mention this briefly). Some people like the extra flexibility that dynamic typing gives, but there's a tradeoff: more errors. The thing is, due to NixOS's complicated structure, the traceback for an evaluation error might not give you any information about where the cause is (indeed, the traceback might not include a single line of your own code!). This makes errors unusually costly in NixOS specifically, so any language feature that causes more runtime errors automatically has a worse impact than it would in a more "normal" language.
  • The "standard library" (builtins) is extremely sparse. You basically have to depend on at least nixpkgs-lib if you want to get any real work done.
  • No real data abstraction mechanisms. No ADTs, no nominal types. The only composite types are attrsets and lists. The usual way to encode a custom type is as an attrset with a _type field or some such.
  • While we're at it, very limited pattern-matching.
  • Clunky list literal syntax: no commas between list elements. I can't tell you the number of times I've forgotten to surround list elements in parentheses.
  • Can anyone remember the rules for escaping ${ or ''? I have to look them up every time.
[–] SolarBoy@slrpnk.net 3 points 6 days ago

Using a language server like nixd also helps a lot with auto completing packages and options in your config.

Apparently people are also working on the nickel configuration language to address some of the nix limitations and difficulties.

[–] danhab99@programming.dev 9 points 6 days ago

I really feel compelled to share that I actually really fucking love nix. I've never felt so confident that my computer would turn on no problem. It was hard and it was rewarding.

Idk I guess I haven't had it for long but once I got my dotfiles the way I like I just stopped messing with it.

Also nix devshells are pretty dope (⁠◕⁠ᴗ⁠◕⁠✿⁠)

[–] steeznson@lemmy.world 7 points 6 days ago (2 children)

NixOS sounds like ansible in OS form and that has never seemed appealing. Happy to hear why my impression is wrong though!

[–] smiletolerantly@awful.systems 6 points 6 days ago (1 children)

Think about it like this:

  • with ansible, you are responsible for making sure that executing the described steps in the described order leads to the desired result

  • with nix, you describe what you want your system to look like, and then figuring out how to get there is nix's problem (or rather, is obvious to nix thanks to nixpkgs)

[–] steeznson@lemmy.world 2 points 6 days ago

Thanks for explaining

load more comments (1 replies)
[–] Sibbo@sopuli.xyz 5 points 6 days ago

It's missing the fact that the nix store can be huge, even if garbage collected regularly. This prevents me from using nix on my Ubuntu laptop with limited HDD space.

[–] LeFantome@programming.dev 2 points 5 days ago

I have not used Nix, so I may not know what I am talking about.

That said, I have been using Chimera Linux which uses the APK package manager. It works by maintaining a single file in /etc/apk/world that specifies all the packages the user wants on the system. This is used to calculate dependencies and install packages. When you “add” and “del” packages, all it is really doing is adding and removing from this list. If you remove a package, it will remove all the dependencies too unless they appear in the “world” file.

If you do not specify a version number for a package, you get the latest. But you can pin versions of you want.

If you copy the world file from one system to another, you get the same set of installed packages.

So, if I use git to backup my world file, maybe a couple of other entries in /etc, and the dot files in my home directory, I have pretty much everything I need to completely recreate my system.

Is it really worth all the extra complexity of Nix?

[–] iopq@lemmy.world 2 points 6 days ago (4 children)

If you download a binary you can just steam-run it and it just works

load more comments (4 replies)
load more comments
view more: next ›