this post was submitted on 18 Feb 2024
128 points (93.8% liked)

Linux

48670 readers
343 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 5 years ago
MODERATORS
 

Distro agnostic packages like flatpaks and appimages have become extremely popular over the past few years, yet they seem to get a lot of dirt thrown on them because they are super bloated (since they bring all their dependencies with them).

NixPkgs are also distro agnostic, but they are about as light as regular system packages (.deb/.rpm/.PKG) all the while having an impressive 80 000 packages in their repos.

I don't get why more people aren't using them, sure they do need some tweaking but so do flatpaks, my main theory is that there are no graphical installer for them and the CLI installer is lacking (no progress bar, no ETA, strange syntax) I'm also scared that there is a downside to them I dont know about.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 39 points 10 months ago

One reason is probably that people don't know about them.

[–] [email protected] 37 points 10 months ago* (last edited 10 months ago) (2 children)
  1. As you can see from the state of this thread, people see nix or nixpkgs but read nixos. There's no momentum from the community to push it as an extra package manager, while every thread is spammed with nixos.

  2. No gui integrations for casuals. For example Discover integrates flatpaks and snaps, but for nix you need to use the terminal.

  3. The documentation is abysmal. I spent days trying to figure out how to use nix as a declarative package manager before I accidentally came across home-manager. Even the manual leads you down the wrong path. A quick start guide with a few examples for home-manager and flakes, and a few basic commands, would've had me going in 5 minutes. That problem is made worse by the fact that almost all sources of info focus on nixos instead.

Edit:

if anyone's interested in trying it out, here's a part of my other comment in this thread

It's just a list of packages, and an optional flake to control the repositories (stable/unstable) and add packages from outside of the official ones.

To update everything nix related I just run:

cd ~/dotfiles/nix/ && nix flake update && home-manager switch

[–] jayandp 11 points 10 months ago (4 children)

Yeah, if it wasn't for my niche needs and desires of using my SteamDeck without touching the system partition, I probably wouldn't have messed with Nix because of how much of a confusing mess of modes and switches there are, and I've used terminal based package managers for years. It's very far from the simple "it just works" of Flatpaks.

load more comments (4 replies)
load more comments (1 replies)
[–] [email protected] 30 points 10 months ago (1 children)

Because it has abominable documentation. Some tools built on top of nix on the other hand have stellar documentation (devenv and jetbox come to mind). The tools even try hard to hide nix because they know it's a goddamn nightmare for beginners to use it.

The CLI is a mess due to the indecisiveness of the nix maintainers whether they want flakes or not. So much so that the official manual doesn't use flakes, but many guides on the internet immediately go into nix dev#yadadada which leaves beginners and mid-term users alike very confused.

Another point is that graphical applications can't use OpenGL without dirty hacks like nixgl. Not only that, installing GUI applications using nix doesn't make them show up in your desktop environment (start menu, finder, whatever). No, you need to either manually create .desktop files or install another tool like home-manager to have them show (and not work properly because of OpenGL).

To top it off, unless you know better, it's command-line only. SnowflakeOS is building GUI tools around nix, but they aren't like say Discover or the Gnome Appstore: you can't install the GUI and have everything working - no, you need to figure everything out.

In short, nix is absolutely nowhere close for desktop user adoption, much less mainstream linux adoption (dev, sysadmin, tester, or whatever other technical role exists).

CC BY-NC-SA 4.0

[–] [email protected] 8 points 10 months ago* (last edited 10 months ago) (1 children)

Flakes confuse me.
Guides online say "oh yeah just do this, it's easy" and don't mention flakes at all.
So I try the thing and it says ARE YOU FUCKING SURE, YOU IDIOT, YOU ABSOLUTE MORON, YOU CAN'T DO ANYTHING WITHOUT ENABLING FLAKES AND YOU HAVEN'T DONE THAT SO YOU CLEARLY DON'T DESERVE NICE THINGS but like, is there just no non-flakes version of that thing, what's the point of having an option that's not enabled by default if you can't do anything without it on

@[email protected] shares my pain and also explained what I was doing wrong:
https://programming.dev/comment/7537131

[–] Drito 5 points 10 months ago (1 children)

Flakes is still experimental. NixOS devs takes a bunch of time to release that. So most experienced users have enabled Flakes since years. Two different systems are available, which does not help ease of learning.

load more comments (1 replies)
[–] [email protected] 21 points 10 months ago (2 children)

Learning curve? I've meant to get around to it but my to do list is pretty big so far.

Nix is on the destinations to visit but the configurations are still confusing at a glance.

[–] [email protected] 4 points 10 months ago* (last edited 10 months ago) (1 children)

If you use Nix the imperative way (nix profile blah), you don't need to learn the Nix language at all, or write config files. Installing/removing/upgrading packages is just a single command, similar to other package managers.

Eg:

  • To search for bat on nixpkgs: nix search nixpkgs bat
  • To install bat: nix profile install nixpkgs#bat
  • To upgrade all packages: nix profile upgrade '.*'

Ref: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 18 points 10 months ago* (last edited 10 months ago) (4 children)

I'm going to go against the grain and say that the Nix and Guix package managers are very good, but they really belong in their respective distros where they're a core part of the system. That'd be Guix System for Guix and NixOS for Nix.

They may have advantages for a foreign distro too, but they are lesser (Guix System can boot into a backup of the system before the last update, for example, but that advantage doesn't exist on, say, Debian.

Also, can we agree to not recommend these systems to new users for the time being? While they're very powerful, they're absolutely designed for power users, and until they're more polished and they have fancy GUIs and stuff for installation and package management, I think it'd be best to keep recommending normal distros like Debian for now.

load more comments (4 replies)
[–] [email protected] 16 points 10 months ago (4 children)

I maintain some software, and Nix is by far the hardest to deal with. To package config files are relatively complex, and to submit a package you have to download the entire Nix repo, which is huge. Getting a package to build correctly can be a challenge.

It's a pretty large ask for software contributors, who may have to iteract with a half dozen different distros. Now, you could say, leave it to the distro people to do the packaging, but it remains a barrier for entry and is by nature exclusive.

I don't use NixOS, so I have little motivation to stay conversant with Nix and, frankly, it's so demanding I don't bother anymore. I can make RPM, deb, and aur packages trivially, and without having to hold Gb of some package repo (which I otherwise don't use) on my disk.

[–] [email protected] 9 points 10 months ago

git clone --depth 1 will clone a git repo without older stuff. Without this, the nixpkgs git repo is like 13-14 GB, but with a depth of 1, it's only 200 mb.

load more comments (3 replies)
[–] [email protected] 16 points 10 months ago (10 children)

Nix packages are a pain to manage on non-nix systems and basically all documentation exists for nixos, not nixpkgs.

load more comments (10 replies)
[–] [email protected] 16 points 10 months ago (2 children)

Flatpaks are much better than AppImages because they don't bring in all of their dependencies, they inherit them from a runtime.

[–] [email protected] 7 points 10 months ago (3 children)

it's the way Nix works too

[–] [email protected] 5 points 10 months ago

Yeah so I don't know why OP is using that argument

load more comments (2 replies)
load more comments (1 replies)
[–] [email protected] 15 points 10 months ago

the aur has everything I need

[–] [email protected] 13 points 10 months ago (1 children)

Part of the reason is that people are still finding out about it, Project has no marketing so it grows organically, in the last year the number of contributors grew by 25 percent.

Another problem is that it still needs polish in term of ease of use, for example it takes me forever to search for packages using the nix-env command but using the website it takes less then a second, That's a basic feature that still does not work correct, Plus their documentation is still not great in my opinion, I actually helped improved it and the improvement they made is still not really good IMO.

[–] [email protected] 10 points 10 months ago

It's cause you're not actually supposed to use nix-env: https://stop-using-nix-env.privatevoid.net/

You're actually supposed to be using nix search nixpkgs#packagename to search and nix profile install nixpkgs#packagename to install.

However, to use both of those, you need to have the "experimental" (not really though, most of the community uses them) features of nix-command and nix flakes enabled, which they aren't by default.

And of course, nowhere on the main documentation did I find any if that, I only found it via the pain of using it wrong, and forum posts.

Nix's documentation is horrific. I've had situations where I only got help via discord...

[–] [email protected] 10 points 10 months ago (5 children)

For me personally, I just haven't taken any steps into the nix environment. Seems rather complex, setting up those nix files and stuff.

I use Debian on servers and LMDE on my PC, most things I need are in the Debian repos and for other cases I get by pretty good with appimage s and flatpaks. Installing is just a simple command and me happy.

Nixpkgs are probably easy too, I assume. I know a lot of people really like nix, but the effort required to start seems significant to me, especially when we have other methods that just work.

load more comments (5 replies)
[–] [email protected] 10 points 10 months ago (7 children)

The way nix installs in my root directory in another distro is a no-go for me

load more comments (7 replies)
[–] [email protected] 9 points 10 months ago (2 children)

You're not exactly comparing apples to apples here.

Flatpak and appimages tend to be used in any distro because they can just be downloaded in a one off manner and installed then you're running the application (for the most part). They offer a manager of sorts but you don't need it to use the packages.

For nixpkgs, whike I'm sure I can get a package from the sounds of the sizes the package covers only the application or the library, meaning I still need the dependencies.

So what exactly would make me the user trade my built in tools (apt/pacman/dnf) for nix? Keep in mind no matter how great you feel it is, you need to provide reasoning that motivates me to install and learn this new tool instead of the old ones I have.

[–] [email protected] 9 points 10 months ago* (last edited 10 months ago) (1 children)

Flatpak still depends on runtimes though, I have a few different runtimes I had to install just because of one or two flatpaks that required them (like for example I have both the gnome and kde flatpak runtimes, despite not running either of those desktop environments)... and they can depend on specific versions of runtimes too! I remember one time flatpak recommended me to uninstall one flatpak program I had because it depended on a deprecated runtime that was no longer supported.

Also, some flatpaks can depend on another flatpak, like how for Godot they are preparing a "parent" flatpak (I don't remember the terminology) that godot games can depend on in order to reduce redundancies when having multiple godot games installed.

Because of those things, you are still likely to require a flatpak remote configured and an internet connection when you install a flatpak. It's not really a fully self contained thing.

Appimages are more self contained.. but even those might make assumptions on what libraries the system might have, which makes them not as universal as they might seem. That or the file needs to be really big, unnecessarily so. Usually, a combination or compromise between both problems, at the discretion of the dev doing the packaging.

The advantage with Nix is that it's more efficient with the users space (because it makes sure you don't get the exact same version of a library installed twice), while making it impossible to have a dependency conflict regardless of how old or new is what you wanna install (which is something the package manager from your typical distro can't do).

[–] [email protected] 5 points 10 months ago

All of these points are completely correct and paint an accurate picture of the inherent issues with both technologies.

My intent with my earlier comment was to show how flatpaks and appimages were different from traditional package managers at a high level so I could ask what made nixpkgs different from something I felt and still kinda feel is a more accurate comparison which are traditional package managers like apt etc.

The big selling point to me now is that nixpkgs seem to work similarly to virtualenvs from Python which is cool.

[–] [email protected] 7 points 10 months ago* (last edited 10 months ago) (13 children)

For nixpkgs, whike I’m sure I can get a package from the sounds of the sizes the package covers only the application or the library, meaning I still need the dependencies.

When you download/build a nix package, nix will absolutely also download all necessary dependencies.

So what exactly would make me the user trade my built in tools (apt/pacman/dnf) for nix?

Getting a shell with a specific package as a one off. Want ffmpeg? nix-shell -p ffmpeg opens a shell with ffmpeg in its path, and only that shell has it.

Along with that, that means users can install packages for themselves. Limited use for single-user systems, but nonetheless it's possible.

Per-project dependencies. Pretty much the same as above, but the dependencies are declared in a file which is part of the project. In many cases that same file can also be used as a nix package itself, like any other in nixpkgs. Very useful if you write software yourself. Here's an example.

Being a source-based package manager with a cache means that you get all the benefits of prebuilt packages but can easily patch or use other versions of a package, with no difference in use (other than that it will build it locally instead of downloading from the cache).

On a distro with a different main package manager I would probably mainly use it for per-project dependencies though.

load more comments (13 replies)
[–] [email protected] 8 points 10 months ago

Pacman (and paru and the AUR) and chezmoi works fine, I don't see any reason to switch.

[–] [email protected] 6 points 10 months ago

I use NixOS on my personal machine and nixpkgs on my work Ubuntu (22.04 LTS). In the absence of NixOS I would not be using it: it somehow breaks all the file (open, save, etc.) windows, causing any app that tries to open one to crash (particularly annoying for browsers).

Not to mention the wrapGL issue.

It needs more polish on "genericlinux". I did previously use it on MacOS, and it did make MacOS almost bearable - definitely years ahead of brew.

[–] [email protected] 6 points 10 months ago

yeah, everybody should use them. I usually write my own kernel mods tailored for my hardware and certain needs, I don't know why not everyone is doing that. admittedly is a bit janky maintaining a separate kernel fork, but you get used to it, everyone should do it

[–] [email protected] 5 points 10 months ago* (last edited 10 months ago) (7 children)

Inate complexity that keeps moving as they introduce things like flakes.

Its a declarative configuration management system as package manager. Thats a lot more to handle off the bat than normal linux + flatpak.

[–] [email protected] 5 points 10 months ago (2 children)

Inate complexity that keeps moving as they introduce things like flakes.

Flakes solve the problem of reproducibility for which nixpkgs (or other external input) revision to use (e.g. in a software project). The main thing they bring is a npm-like lock file and a predictable interface. You don't have to use them if you don't want that.

Its a declarative configuration management system as package manager.

No it isn't. That's NixOS, which is another thing built on top of Nix and nixpkgs. nixpkgs is first and foremost a package collection.

load more comments (2 replies)
load more comments (6 replies)
[–] [email protected] 5 points 10 months ago (4 children)

NixOS sounds amazing in some regards, but I'm not really interested in learning a whole programming language for it... I have enough to do already.

[–] [email protected] 5 points 10 months ago

The nix package manager can be used on any os and doesn't require usage of the nix programming language..

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