One aspect of Guix I found to be really fascinating: That there is basically no conceptual difference between defining a package as a private build script, and using a package as part of the system.

Let me explain: Say you wrote a little program in Python which uses a C library (or a Rust library with C ABI) which is in the distribution. Then, in Guix you would put that librarie’s name and needed version into a manifest.scm file which lists your dependency, and makes it available if you run guix shell in that folder. It does not matter whether you run the full Guix System, or just use Guix as s package manager.

Now, if you want to install your little python program as part of your system, you’ll write an install script or package definition, which is nothing else than a litle piece of Scheme code which contains the name of your program, your dependency, and the information needed to call python’s build tool.

The point I am making is now that the only thing which is different between your local package and a distributed package in Guix is that distributed packages are package definitions hosted in public git repos, called ‘channels’. So, if you put your package’s source into a github or codeberg repo, and the package definition into another repo, you now have published a package which is a part of Guix (in your own channel). Anybody who wants to install and run your package just needs your channel’s URL and the packages name. It is a fully decentral system.

In short, in Guix you have built-in something like Arch’s AUR, just in a much more elegant and clean manner - and in a fully decentralized way.

  • balsoft@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    One aspect of Guix I found to be really fascinating: That there is basically no conceptual difference between defining a package as a private build script, and using a package as part of the system.

    This is true for Nix as well.

    The two main advantages of Guix are the language (which is well-known and comes with lots of good tooling and other support) and the package bootstrapping.

    • Shareni@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      The main disadvantages I’ve faced when trying it a few years ago:

      • non-free packages need to use a non-official channel
      • I had to install guixos through the iso provided by systemcrafters to have non-free drivers
      • I couldn’t get any help from the official guix irc because I used the modified iso, even though the issue had absolutely nothing to do with it
      • there’s significantly less packages in both than in nix, and they’re usually seriously outdated (the docker package was behind Debian for example)
      • even when I enabled downloading precompiled bins, some packages like firefox and chromium would still compile all night long

      At the time it was a great concept, but essentially useless for anything not Emacs/Haskell related.

      • HaraldvonBlauzahn@feddit.orgOP
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago
        • non-free packages need to use a non-official channel
        • I had to install guixos through the iso provided by systemcrafters to have non-free drivers

        Yeah. See, drivers are part of the hardware abstraction layer which in a Linux system is the Kernel. The kernel is GPL, so it is hard to get support for hardware with drivers without GPL, it does not conform Linux’ license.

        I, too, had also nothing but hassle with an NVidia graphics card in Debian. It was a happy day when I finally ditched it for a supported card and had a fully supported system!

        The other thing… let’s turn the question around. Would you:

        • expect from Apple that you get your Mac with The Gimp pre-installed?
        • From Microsoft that they pre- install LibreOffice and provide it for free in their app store?
        • Expect from IBM or Brother that they develop and give you free drivers for their competitor’s hardware?
        • Expect from Google that they give you free LaTeX support?
        • Expect from Adobe that they host and staff tje Linux Kernel Mailing List for free?

        If not - why do some people expect equivalent things from free software projects?

        • Shareni@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          The kernel is GPL, so it is hard to get support for hardware with drivers without GPL, it does not conform Linux’ license.

          It’s a violation that’s not enforced, as almost all distros provide proprietary blobs. They balance ideology with usability, since they realised most people aren’t going to use a librebooted ThinkPad from the 90s. If everyone enforced libre purism like GNU, desktop Linux would’ve been completely dead long ago. If you need proof, check usage statistics for any of the free distros.

          I, too, had also nothing but hassle with an NVidia graphics card in Debian.

          And did you need to install a modified iso to have WiFi? Did maybe Debian provide those nvidia drivers?

          The other thing… let’s turn the question around. Would you:

          How is any of that relevant? This is not a question of additional software or services, but basic usability. Guixos as is, is for example essentially useless on a laptop unless you’re willing to carry an external WiFi card in your pocket.

          If not - why do some people expect equivalent things from free software projects?

          The only expectation I have for an OS is to work on my devices, guixos does not. And even when I jumped through all of the hoops to get it working, I still needed to use nix to install most packages I need to work. So why would I use guixos+nix+flatpak instead of just running nixos?

          • HaraldvonBlauzahn@feddit.orgOP
            link
            fedilink
            arrow-up
            0
            ·
            edit-2
            3 months ago

            The only expectation I have for an OS is to work on my devices

            So maybe Guix System is not a good choice for you?

            It has top-priority goals like reproducibility, capability to inspect and verify all source code, and providing a fully free system. These specific goals are not compatible with providing nonfree binary blobs in Guix-core. For example, depending on non-free binary blobs will block exactly reconstructing a system years later if these binaries are not available any more. Guix has scientific applications where reproducibility absolutely matters.

            Also, I can unterstand if companies are hating it which just want to have a free ride and monetize efforts of other people. But for users, there are many many other options and distributions available. Why not chose one that matches your need better?

            • Shareni@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              3 months ago

              Also, I can unterstand if companies are hating it which just want to have a free ride and monetize efforts of other people. But for users, there are many many other options and distributions available. Why not chose one that matches your need better?

              Why get mad about people comparing nix and guix, in a thread comparing nix and guix? Pointing out legitimate disadvantages is not hating. Maybe get off the internet for a bit and touch grass.

              It has top-priority goals like reproducibility, capability to inspect and verify all source code, and providing a fully free system that is not compatible with providing nonfree binary blobs.

              So does nix, nobody is forcing you to opt-in into non-free packages. And guix most certainly is compatible with non-free blobs, as that’s how most people are using it. The only difference is that nix is supporting non-free packages instead of banning even talking about them.

    • msherburn33@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      The two main advantages of Guix are the language

      I wouldn’t call that an advantage for the average person. Nix is far nicer to work with. Some Lispers might disagree, but I, for one, can’t exactly see the beauty in trying to turn Scheme into a configuration language with macros and hacks. Also Guix puts Scheme everywhere, things you can do with plain old Bash in Nix, you’ll have to all do in Scheme in Guix, so there is a much steeper learning curve.

        • msherburn33@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          You prefer:

               (add-after 'install 'remove-examples
                 (lambda* (#:key outputs #:allow-other-keys)
                   (with-directory-excursion
                       (string-append (assoc-ref outputs "out") "/lib")
                     (for-each delete-file
                               (list
                                "basic-server"
                                "helloworld"
                                "postcollector")))
          

          over:

          postInstall = ''
             rm  $out/lib/basic-server $out/lib/helloworld $out/lib/postcollector
          ''
          

          ?

          • balsoft@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            3 months ago

            Bash code should definitely be

            rm -f "$out"/lib/{basic-server,helloworld,postcollector}
            
          • HaraldvonBlauzahn@feddit.orgOP
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            3 months ago

            Yes, having programmed bash and its predecessors for 30 years and several lisps (Clojure, Racket, Guile, a little SBCL) in the last 15 years, I very much prefer the Scheme version in this place.

            Why?

            • This code fragment is part of a much larger system, so readability and consistency counts
            • The Guile version supports a more powerful functionality, which is that evaluation of a package can have several extra results (called outputs). It is over a year that I read about that in the Guix documentation and yet I recognize it immediately.
            • the code tells me that it is removing examples.
            • the code fits neatly into a tidy system of several stages of build and packaging
            • the code uses a structured loop. Of course you can do that in shell as well - I am pointing this out because the bash version is a bit shorter because it does not use a loop.
            • Scheme has much safer and more robust string handling. The code will not do harmful things if a file name contains white space or happens to be equal to 'echo a; rm -rf /etc/*'.
            • Scheme strings handle Unicode well
            • If there is an error, it will not be silently ignored as is the norm in shell scripts which are not written by experts, but will throw it.
            • the code has less redundancy. For example, the bash version mentions three times the subfolder “lib”, the Guile version only once. This makes it easier to refactor the code later.