this post was submitted on 03 Jul 2025
162 points (96.6% liked)

Linux

56017 readers
1043 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
[–] msherburn33@lemmy.ml 7 points 8 hours 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 5 hours ago* (last edited 5 hours 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 5 hours 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 7 points 13 hours 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 (⁠◕⁠ᴗ⁠◕⁠✿⁠)

[–] iopq@lemmy.world 2 points 11 hours ago (1 children)

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

[–] smiletolerantly@awful.systems 1 points 8 hours ago (1 children)
[–] SolarBoy@slrpnk.net 1 points 5 hours ago

This command will just run an executable file on nix. Normally only executables which are installed from the package manager will work.

appimage-run is another option. Which can be used to run, you guessed it, appimages

[–] Sibbo@sopuli.xyz 4 points 15 hours 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.

[–] steeznson@lemmy.world 6 points 18 hours 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 5 points 8 hours 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 7 hours ago

Thanks for explaining

[–] aim_at_me@lemmy.nz 0 points 10 hours ago

Ansible is idempotent with a lot of intent. NixOS is idempotent.

[–] phantomwise@lemmy.ml 28 points 1 day ago* (last edited 1 day ago) (10 children)

I've been stuck on Nix for two weeks because I thought it would be a good idea to put a distro I had never used but that wouldn't break on my backup laptop in case my main one ever broke. I just couldn't force myself to install debian, not that I have anything against debian, it's just... kinda boring, while Nix seemed very interesting. IT SEEMED LIKE A GOOD IDEA AT THE TIME I SWEAR.

Guess what happened... I broke Arch. Then I reinstalled and the next day the laptop broke. Then the next day I tried to get my data back and the hard drive broke. So, backup laptop with Nix for two weeks...

  • I really really really like the declarative stuff. Installing packages through config files is so nice I'll never lose track of what I've installed ever again 🥰 🥰 🥰 I was already using a git repo for all my config files + GNU Stow to symlink everything to its proper place, so adding the .nix configs to that setup was very easy.
  • Having a clean system on rebuild is great. No more clutter left everywhere that I don't know about, no more half broken stuff left lying around.

But...

  • It's not Arch. Not Nix's fault, but I kept hearing that it would be "like Arch but declarative"... and it's really not 😑 Everything seems over-complicated vs as simple as possible.
  • I absolutely hate the language.
  • What's with those error messages from hell???
  • And speaking of hell, every language that can't just use indentations like YAML instead of cluttering the code with {} and [] and () should have been relegated to the darkest pit of hell 20 years ago. But points to Nix for being less awful than JSON (the comma on every line but not the last thingy make me want to build a time machine to go murder the grandparents of whoever thought it was a good idea)
  • Packages are out of date even in the unstable branch (I know it's unfair since it's not trying to be a rolling release... but... but...)
  • Where are the source packages? Is that an Arch only thing? I liked having packages that automatically use the latest git commit without needing to manually install from source and manually reinstall each time I want an update like a medieval peasant... 😭
  • Nix packages are weird. Even someone who's terrible at coding like me can read Arch PKGBUILDS... I miss you Arch 😢
  • Apps not working because of paths that don't exist on Nix... what do you mean I need to patch the package myself? 😭 But at least there's steam-run, great preserver of what's left of my sanity.
  • Can't wrap my head around installing some stuff like VSCode extensions (the advice I got was "don't bother just do it imperatively 😑 )
  • Wiki is often sparse on info and not very helpful if you don't already know what you are doing (and I clearly don't 😅)
  • Hidden configs. Some stuff works on its own like pipewire even though I haven't installed or configured it (I went with a minimal install that just gave me a tty then build from there, no DE), and how it's already configured is not in the default config files. It's very confusing not knowing why some stuff works and how it's configured by default.

But it's kinda growing on me. Like mold. Or cancer. Brain cancer.

[–] msherburn33@lemmy.ml 3 points 8 hours ago

Where are the source packages?

It's reproducible, so random updates are a no-no. You can however just dump the Git URL in your flake.nix inputs and then override the src of the package with that. The source gets updated when you do nix flake update next time. Something like this:

inputs {
    ...
    mypackage_src.url = "github:myorg/mypackage";
    mypackage_src.flake = false;
    ...
}
pkgs.mypackage.overrideAttrs (oldAttrs: {
              src = mypackage_src;
              version = "nightly-${mypackage_src.shortRev or "src"}";
            })

[–] iopq@lemmy.world 4 points 11 hours ago

Nix has more up to date packages than most distros have packages in total. There's a bot that goes around updating them automatically if they are from github. Maybe there's an issue with your package?

[–] HayadSont@discuss.online 4 points 14 hours ago (1 children)

Packages are out of date even in the unstable branch (I know it’s unfair since it’s not trying to be a rolling release… but… but…)

Sure, some packages are outdated. But in terms of percentage of up-to-date packages, it's (AFAIK) the best out of any distro repo. And that's perhaps even more impressive of a feat when realizing it also sports the biggest repo. For actual stats: https://repology.org/repositories/statistics/pnewest

[–] phantomwise@lemmy.ml 1 points 13 hours ago (1 children)

Wait how does Nix Unstable have a better score than the AUR? With four times less maintainers? That's really impressive, especially considering how much more simple Arch packages are to make.

[–] iopq@lemmy.world 2 points 11 hours ago

Because you end up feeling unsatisfied with running the thing until you package it. I don't even understand the Nix language and I still messed around with a couple of packages

[–] SkaveRat@discuss.tchncs.de 2 points 17 hours ago (2 children)

But points to Nix for being less awful than JSON (the comma on every line but not the last thingy make me want to build a time machine to go murder the grandparents of whoever thought it was a good idea)

https://en.wikipedia.org/wiki/Douglas_Crockford

[–] phantomwise@lemmy.ml 1 points 13 hours ago

There's one evil genius responsible for both JSON and JavaScript? °o°

[–] lapping6596@lemmy.world 2 points 16 hours ago

Yeah, fuck that guy!

[–] eecobb@lemmy.sdf.org 4 points 20 hours ago* (last edited 20 hours ago) (2 children)

I wonder what your thoughts on guix would be, especially considering your thoughts on the language

[–] phantomwise@lemmy.ml 5 points 14 hours ago

Succinctly : "OH GOD MY EEEEEYES"

I'm not a fan of nested parenthesis... but aside from that I don't know much about the language, is it more convenient? Does it also suffer from the error messages from hell problem?

[–] greywolf0x1@lemmy.ml 2 points 19 hours ago* (last edited 19 hours ago)

I'm just seeing your comment after I recommended Guix, that I could read and understand Guile Scheme is what made me hop away from NixOS, the nixlang is an ungrokable mess

[–] greywolf0x1@lemmy.ml 2 points 19 hours ago (2 children)

I absolutely hate the language

Check out Guix_System_Distribution, it's just like NixOS but uses a Scheme dialect which is a better language.

[–] msherburn33@lemmy.ml 3 points 7 hours ago

While some people love putting Lisp in everything, I really don't get it. Guix is far uglier than Nix in the language department. Scheme is not a configuration language and thus has none of the nice things that Nix has (multi-line string handling, defaults, lazy evaluation, inline expression, etc.), instead you get multiple levels of macro spaghetti. Furthermore, Guix forces you to turn everything into Scheme, where you can just use plain Bash in your Nix build steps, in Guix that is all Scheme.

I had spent a lot of years with Scheme before starting with Guix and then spend quite a few years with that, but even after all that switching to Nix just felt so much better instantly. Instead of trying to hack a DSL onto of Scheme you just get a language that's actually build for the task.

[–] thedeadwalking4242@lemmy.world 2 points 17 hours ago (1 children)

If you like parentheses anyway

[–] msherburn33@lemmy.ml 2 points 7 hours ago

That is something you can't quite escape in Nix either. While it doesn't use parenthesis like a Lisp, the nature of the language and the depths of the sets you are dealing with still makes you end up getting a lot of this at the end of your files:

        ];
      };
    };
  };
}

Having one } too many or too few is a pretty common issue with Nix and feels very similar to Lisp, even when the rest of the language is quite different.

[–] phantomwise@lemmy.ml 10 points 1 day ago (1 children)

I'm sure it'll get better once I'm more used to it, just venting a bit. Sorry for the rant

[–] Bluefruit@lemmy.world 5 points 21 hours ago (1 children)

I found this very entertaining lol. And it also confirms I made the right choice not using Nix as my daily driver. This sounds like a headache.

[–] phantomwise@lemmy.ml 4 points 13 hours ago

Yes it's a headache if you don't have a clue what you're doing and suck at coding like me, but the good parts might make the headache worth it depending on what you want of your distro. A week ago I couldn't wait to get a new laptop to reinstall Arch, but now I'm actually wondering if I should keep trying Nix... OH GOD HAVE I CAUGHT THE NIX BRAIN CANCER? 😭

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