Skip Navigation

What are your thoughts on Flatpak/Flathub?

flathub.org About | Flathub

Flathub aims to be the place to get and distribute apps for Linux. It is powered by Flatpak which allows Flathub apps to run on almost any Linux distribution.

About | Flathub

How does it stack up against traditional package management and others like AUR and Nix?

210

You're viewing a single thread.

210 comments
  • How does it stack up against traditional package management and others like AUR and Nix?

    I only used AUR for a few packages (<5 at a time). It's to be avoided and only used if the other options are a massive pain (unless it's an official package).

    Then I left Arch and eventually landed on MX. During that time Nix with home-manager has slowly replaced flatpak, and I don't even have it installed anymore. Nix is better in every way, except for ease of use.

    Flatpak has great gui integration (for gui tools). You can click through everything, and the updates are unified. It usually works perfectly fine if you just need to install a few programs.

    With nix, there's a lot more setup, but there are many benefits. You end up with a list of packages, and that's really useful because you can take a fresh install, install nix and home manager, and then run a single line to reinstall everything. You can rollback updates, pin specific versions, install packages from a repo (if it has a flake.nix with outputs), and also configure them. I'm using the unstable branch, and it's giving me bleeding edge packages on Debian. And there's no risk of outdated system libraries, like with flatpak, because it provides everything.

    • That all sounds great, thanks!
      Do you have any tips for an "easy" start, where everything is already pre-configured?

      • Nope, and that's the worst part of nix. I'm actually planning on writing a short startup guide, but I need to solve a few more issues first.

        But, this should help you out until then:

        The home.nix should be automatically generated, and that's where you put all of your packages. I left a few as an example.

        NixGL is needed to use openGL (nixGL lutris for example). It works in most cases, but I couldn't get alacritty or kitty to work. There are some ways to have packages automatically use it, but I still haven't tried them out.

        Flake allows you to select the correct nix repo (stable/unstable), appropriate home-manager version, and add outside packages like nixgl. It's technically not necessary, but I wouldn't go without it. Here I'm using the unstable repository, check the relevant docs if you want to go with releases instead.

        The equivalent of apt update && apt upgrade is nix flake update && home-manager switch --impure. I like cd-ing into the nix dotfile directory (all of the files are in there and symlinked to ~/.config/ locations), but you can also use command line arguments to point to the flake.

        nix flake update updates the package definitions to what's in the repo

        home-manager switch install them, and also updates any configs it's managing. The --impure is only needed if you're using nixgl (bad build commands depend on system time).

        nix-collect-garbage to force a clean up of unused packages

        https://search.nixos.org/packages makes searching for packages a lot easier

        https://mynixos.com/search?q=home-manager+ same, but for finding options to configure packages through home-manager

        Comment if you need help

        update: removed nixGL from flake and home, installed it through nix-channel in order to not use --impure during home-manager switch

        • Thanks! I saved the comment for later.

          What advantage do you see in Nix compared to Distrobox?
          I personally enjoy DB because of its simplicity.
          I just open BoxBuddy, create a new container from the dropdown-list, and then just start using my Debian or Arch container on top of Fedora Atomic for example.

          The two main benefits I see in Nix are the reproducibility and the big repo. But in case of the repository size, Debian and Arch (+ AUR) are extremely big aswell.
          Are there any other big benefits, that I can't get with Distrobox, but with Nix?
          Just as a small side note, I'm no power user and tend to use my PC more like a casual guy.

          • I haven't used distrobox, so take this with a grain of salt:

            • reproducibility: if you copy my nix files, the flake.lock will ensure you have the exact same results as me

            • declarative package management: you make a list of packages and the declarative nature forces you to keep it up to date at all times, that's how you install/remove them. On arch you need to -Syu the package and remember to add it to an installation script (I never did). This also allows for easier maintenance because you don't need to go through random dependencies to find an unused package you've installed (~100 packages on the list == almost 2000 packages installed). If there's a distrobox version of a Dockerfile, you can do the same but it will most likely have the same disadvantages.

            • home-manager allows you to configure packages (usually not worth it though)

            • no need to export packages, when you install them they're immediately available in your main distro

            • combine these and you have an extremely simple setup to distrohop, or work on multiple devices. You can also for example break off certain packages in a separate module, and only install them on a certain machine.

            • I'm guessing updates are easier, and if it breaks something, you can easily rollback to a previous generation. It will not only revert to the exact same packages you used previously, but it will also revert any package configs it controls. And on top of that it lets you pin a package to a specific version, and upgrade everything else.

            • cross-platform: you can take your list and install the same packages on win/mac natively. They don't need to run linux in a vm like a container would

            • less storage used?

            • temporary package installs. For example I only needed arandr for 30 seconds to set up a new monitor, so I just nix shell nixpkgs#arandr and it created a shell with that package. When I was done I just closed the terminal, and didn't need to think about it anymore. The package was completely removed the next time I ran nix-collect-garbage.

            • you need a package that's in no repository, but it has a flake with all of the compilation dependencies? You just cd into the repo, nix develop, and you've got a temporary environment with everything you need to start following the compilation instructions

            But in case of the repository size, Debian and Arch (+ AUR) are extremely big aswell.

            Arch has a lot of packages, but there are some that I had to install through aur which I don't like. Nixpkgs have so far had everything I needed, except for nixgl (although I couldn't get a few of them to work). Also, you can chose between "stable" and unstable repos. Arch doesn't have a frozen version with updates every ~6 weeks, and no other release based distro comes even close in either quantity or freshness.

            That's what I can think of for a casual user. There are a lot more benefits for professionals to be honest, and I wouldn't suggest nix at all if home-manager didn't massively simplify the whole process. Getting to those few simple files from above was a massive pain, and it's made even worse by the official nix guide suggesting outdated methods, and most of the support threads being for nixos. With them, you can get going in like 10 minutes even if you don't know anything.

210 comments