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.

  • FlapKap@feddit.dk
    link
    fedilink
    arrow-up
    4
    arrow-down
    2
    ·
    9 months ago

    How does it solve the problem of dependencies without becoming bloated?

    • clemdemort@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      9 months ago

      From what I gather it goes something like this:

      • every package is assigned a hash
      • every package lists their dependencies through their hashes
      • different versions of packages have different hashes
      • when you launch an application it creates an environment with all its dependencies, this means that two applications that both use the same library at the same version share that library. However if they both require the same lib but not the same version of that lib they don’t share it.

      Which solves DLL hell as far as i understand it.

    • ZephrC@lemm.ee
      link
      fedilink
      arrow-up
      2
      arrow-down
      14
      ·
      9 months ago

      By not being a universal packaging format. It uses your system libraries, which completely eliminates the main reason devs are pushing for things like Flatpak, Snap, or Appimage.

      • TheEntity@kbin.social
        link
        fedilink
        arrow-up
        13
        ·
        edit-2
        9 months ago

        It doesn’t use the system libraries, unless the system in question is NixOS. It still provides its own dependencies. Arguably in a more elegant and less wasteful manner, but they are still distinct from the ones used by the rest of the system.

        EDIT: typo

        • ZephrC@lemm.ee
          link
          fedilink
          arrow-up
          5
          arrow-down
          4
          ·
          9 months ago

          To be more clear, it uses a weird combination of your system libraries, installing its own libraries into your system on its own without informing your primary package manager, and using some specific library versions separate from your system libraries for some apps.

          If you want to call that more “elegant” than other solutions… Well, I can’t tell you how to feel about something. It still doesn’t actually solve the problem that universal package formats are trying to solve unless the package dev explicitly requires so many specific library versions that the whole thing just ends up being an AppImage with extra steps though.

          • Ferk@kbin.social
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            9 months ago

            The packager always should “explicitly require” what are the dependencies in a Nix package… it’s not like it’s a choice, if there are missing dependencies then that’d be a bug.

            If the package is not declaring its dependencies properly then it might not run properly in NixOS, since there are no “system libraries” in that OS other than the ones that were installed from Nix packages.

            And one of its advantages over AppImages is that instead of bundling everything together causing redundancies and inefficient use of resources, you actually have shared libraries with Nix (not the system ones, but Nix dependencies). If you have multiple AppImages that bundle the same libraries you can end up having the exact same version of the library installed multiple times (or loaded in memory, when running). Appimages do not scale, you would be wasting a lot of resources if you were to make heavy use of them, whereas with Nix you can run an entire OS built with Nix packages.

          • Atemu@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            it uses a weird combination of your system libraries, installing its own libraries into your system on its own without informing your primary package manager, and using some specific library versions separate from your system libraries for some apps.

            That is not at all true.

            There is one explicit case where “system libraries” are used by Nix programs and that is graphics drivers. This is not done outside of NixOS as it does not trivially work there; it’s still an open problem. We can discuss about the reasons for this impurity’s existance and its intricacies but all that is important here that this impurity is the sole exception, not the norm.

            Apart from that, Nix will never under any circumstances load (much less modify) libraries of any kind from any global path; system-controlled, user-controlled or otherwise. That’d be contrary to the fundamental principles of Nix.

            It will always use “specific library versions separate from your system libraries” aka. the explicitly and exhaustively precisely declared dependencies in the Nix store. That’s the whole point of it.

            I’d recommend you read up on Nix again and revise your opinion once you understand what it actually does because it’s clear that whatever source you had for information on Nix was entirely wrong.

      • Ferk@kbin.social
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        9 months ago

        Huh? as far as I know it has its own libraries and dependency system. What do you mean?