Linux
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
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
One reason is probably that people don't know about them.
-
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.
-
No gui integrations for casuals. For example Discover integrates flatpaks and snaps, but for nix you need to use the terminal.
-
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
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.
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).
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
@moonpiedumplings@programming.dev shares my pain and also explained what I was doing wrong:
https://programming.dev/comment/7537131
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.
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.
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
Nix packages are a pain to manage on non-nix systems and basically all documentation exists for nixos, not nixpkgs.
Flatpaks are much better than AppImages because they don't bring in all of their dependencies, they inherit them from a runtime.
it's the way Nix works too
Yeah so I don't know why OP is using that argument
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.
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.
the aur has everything I need
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.
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...
The way nix installs in my root directory in another distro is a no-go for me
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.
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.
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.
I often stumble on this example of nix usage - a one-off shell with a a specific package. This is such a niche and seemingly unimportant use case, that it’s really strange to have it mentioned so often.
Like literally what’s the point of having a shell with ffmpeg? Why not simply install it? Even if you need something just once, just install it and then uninstall it, takes like 10 seconds.
The other use case that is often brought up is for managing dev environments, but for a lot of popular languages (Python, Node, Java, Rust, etc. ) there are proven environment management options already (pyenv and poetry, nvm, jenv, rustup). Not to mention Docker. In the corporate setting I haven’t seen nix replacing any of these.
From my limited experience using home manager under Linux and macOS:
- GUI app shortcuts work in neither of the OSs
- error messages are about as readable as the ones you get for C++ templates
- a lot of troubleshooting searches to unsolved GitHub issues
All in all nix seems like a pretty concept but not too practical at the moment.
I often stumble on this example of nix usage - a one-off shell with a a specific package. This is such a niche and seemingly unimportant use case, that it’s really strange to have it mentioned so often.
It's probably one of the simplest things you can do with it that isn't really possible with other package managers and also doesn't require explaining any internals, I guess that's why.
I could also tell you about easily being able to build statically linked binaries or cross-compile (or both) with the same package definition without having to do any extra work, that might be more impressive.
The other use case that is often brought up is for managing dev environments, but for a lot of popular languages (Python, Node, Java, Rust, etc. ) there are proven environment management options already (pyenv and poetry, nvm, jenv, rustup).
Yeah, and neither of them considered that it might be important to deal with software written in other languages. Want to link against a C library in a Rust project? Run some tool as part of NPM build step? Screw you, install it manually from elsewhere or your build fails. The only one that I know does do this is OCaml's OPAM, which does have a lot of non-OCaml software packaged. (Also at least the latter three seem to be only for setting up the language itself. What is this, a package manager for a single package?)
Not to mention Docker.
Meh, Docker is kind of a joke. Sure, it solves the problem of dependencies, but in possibly the stupidest way possible bar shipping a VirtualBox image. A lot of prebuilt images are x86_64 only. It needs to run a Linux VM on Mac and Windows (tbf Nix doesn't have a native Windows version at the moment either, you need to run it in WSL, but people are working on that). So that means running at native performance on an ARM Mac, which are quite common for development I think, is out from the start. It also adds a lot of complexity to your environment due to wrapping everything in a container if you just want to have a couple tools. You don't get your nicely configured shell, other system tools, anything else inside the container. I haven't ever tried it but you probably also need special support from any IDE you want to use.
(And not to mention most Dockerfiles being absolutely not reproducible, but you can solve that... with Nix :^) )
- GUI app shortcuts work in neither of the OSs
On Linux I think you need to link ~/.local/share/applications to home-manager's share/applications. Not sure about Mac, its GUI kind of hates symlinks and Nix uses a lot of symlinks. Spotlight doesn't read anything behind symlinks at all, for example, and Launchpad resolves them so after a package update it will not pick up the new versions because it's still looking at the old path.
- error messages are about as readable as the ones you get for C++ templates
Unfortunately true, yeah. I also think this isn't really a problem that can be solved due to Nix being a dynamically typed language that has everything be an expression (so there's no fixed structure whatsoever) and also using lazy evaluation everywhere. Three components that all decrease the capability for useful error messages and debugging, and together… yeah it can get pretty bad.
- a lot of troubleshooting searches to unsolved GitHub issues
Really? This hasn't been my experience at all. There's a couple like that, sure, like the build sandbox on Mac, but they're rare. And usually people in the community channel know a workaround :^)
Like literally what’s the point of having a shell with ffmpeg? Why not simply install it? Even if you need something just once, just install it and then uninstall it, takes like 10 seconds.
The last time I used it, I needed arandr just to create a layout with a new monitor. Why would I install it, use it, remove it, and then auto remove the leftovers when I can just run a single line to use it once and forget about it? My old installs were littered with random crap like that that I've used once and forgot to remove.
The other use case that is often brought up is for managing dev environments, but for a lot of popular languages (Python, Node, Java, Rust, etc. ) there are proven environment management options already (pyenv and poetry, nvm, jenv, rustup).
Here's the last time I used it: I needed to compile some rust binary but I don't have rust or cargo installed. Since the repo has a nix flake, I was able to clone it, cd into the directory, run "nix develop", and start compiling. Much easier than having to find and install all of the compile time dependencies, and then remove them a minute later.
Besides that, there's a reason why python has different 20 venv packages: they're all crap. Nix is a better alternative and leaves you with a single dependency for every OS.
Not to mention Docker. In the corporate setting I haven’t seen nix replacing any of these.
Declarative package management definitely has it's benefits, and nix has been growing in that space ever since they've added the option to generate docker images from nixos configs. It's not meant to replace docker, just to give you an option to create finely tuned base images.
GUI app shortcuts work in neither of the OSs
Home-manager on Debian: no manual set up was required.
error messages are about as readable as the ones you get for C++ templates
They can get overly long, but perfectly raadable if you start from the bottom.
All in all nix seems like a pretty concept but not too practical at the moment.
Nixos sure, but with nix I get the same bleeding edge userland packages on Debian and whatever else I'm running at the time. It's just a list of packages, but it makes life so much easier.
Pacman (and paru and the AUR) and chezmoi works fine, I don't see any reason to switch.
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.
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.
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.
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.
The nix package manager can be used on any os and doesn't require usage of the nix programming language..