I Might Be Leaving Artix Soon

I think NixOS is looking really promising

06/01/2022

Ever since I first found out what a package manager does, I always thought that it would be cool if I could create my own package manager that worked simply from install scripts. When I used Ubuntu and all of the other normal "beginner" distros with their snaps and flatpaks and appimages and whatnot, I always thought that a generic shell script could easily do all of the stuff that these package managers were doing, and more. When I made the real switch to Artix, I found out about the AUR, and I must say that I was impressed. Not only was I impressed, I didn’t really understand what it was doing. After a while, I realized that PKGBUILDs were just shell scripts that were interpreted with makepkg, and that’s really cool! If you know anything about me, you know that I love shell scripts for everything. Heck, I’m using the blogging script I mentioned a couple posts ago to type this out! Anyways, I ended up watching a tutorial on how to make a PKGBUILD and I made a script for spdl, the StepMania Pack Downloader. And so that was that for a while. But in the back of my mind (as well as through many posts on 4chan), I kept reminding myself about NixOS. I have a good (online) friend who told me about Nix a while ago and how it has the most packages out of any package repo, and I laughed at him, telling him that the AUR was all that I needed. However, unlike the AUR, all of the packages on NixOS are official. And how do you install them? Not grab a binary release from some central server, no. You see, Nix itself is a language, and you create almost a .nix program that holds the instructions for building the package. So in a sense, it’s like a PKGBUILD, but it’s the only way to install packages. And there aren’t a million repositories out there for all of the Nix packages, there’s one: a GitHub repository called nixpkgs. And it’s very convenient. Every program that you could possibly install on NixOS has a default.nix file for you to build it from. And through NixOS’s package manager (which, by the way, is also called Nix and is distribution-agnostic and won’t mess with your dependencies) you are basically just running the .nix file and doing whatever it tells the computer to do. Once you figure out what the derivations (PKGBUILDs basically) are doing, you can start to figure out more and more about the Nix system. I’ve installed Nix (the package manager) on the school Linux computer to test it out. All you have to do is install it using the script on their site and append

    source "$HOME/.nix-profile/etc/profile.d/nix.sh" 

to your shell’s rc and it will set up all of the proper environmental variables for you. If you want to use nonfree programs, also append

    export NIXPKGS_ALLOW_UNFREE=1

to your shell’s rc.

I look forward to using the Nix package manager, though I will inevitably make the entire switch. I’ve started making some of my own nixpkgs here so I can keep my packages.