pellets: manage your packages with a configuration file
Hello! A while back I made pellets as a way of keeping track what I installed on my system so that I could clean up things I didn't need anymore. It also made setting up a new machine much quicker. Really what I wanted was something like Nix, but I went on a very long saga trying to use it as a package manager with Arch and it was... not viable. So I made pellets as a middle-ground: it's just a simple bash wrapper around pacman and doesn't demand complete control, but you can use a configuration file to keep your packages synchronized to a desired state. It also prunes old dependencies. I've been using it for over a year now and am really happy with the result.
I thought it was time to share it, so I just put it on the AUR if anyone is interested in trying: https://aur.archlinux.org/packages/pellets
And if anyone is curious, this is roughly what my config looks like: https://github.com/dpatti/dotfiles/blob/master/.config/pellets/packages
About this post
- Posted
- Archived
- Score
- 76 ยท 95% up
- Kind
- Text
- ID
- ynus51
22 comments
What's the difference between this and https://github.com/CyberShadow/aconfmgr ?
Pellets is very much limited to only what packages are installed, and roughly stops there. It's quite simple in its implementation, but this project looks pretty impressive.
Cool project! Have you also explored pacdef? It does something similar to pellets but that bundles packages in groups for better granularity between hosts. A blessed middle ground between Arch and Nix.
I have not, thanks for the share! I only have one install of Arch at any given time, but I can see how this would be useful otherwise. (And had I known about it beforehand, it might have just been good enough for my use case too.)
I was just wondering 6 people starred my repo on the same day, 4 days ago. Thanks for the PR. :)
๐ค
So, what is the workflow to move from one PC to another? This makes a list of all installed packages and then install them on the new pc? Am I getting you right?
It's nothing more fancy than a list of all packages you want installed and a way to install them, in the case of migrating to a new machine. Because I already keep all my dotfiles in a single repo, it was a natural place to put my desired setup as well.
Yeah I understand. I will give this a shot after I get my new ssd
I use a pacman hook to make a list of regular packages used and AUR packages.
https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#List_of_installed_packages
What makes this different?
It's more or less that! Just all in one file and with the ability to annotate it since I don't always remember what I installed a given package for.
However, by design, I like to keep my list of packages updated by hand. This makes it easy for me to, say, install a new package to try something out, and then later get reminded that it's still installed. I can either explicitly add it to my config or let pellets clean it up if I don't want it anymore.
I wish we had something like this, but more "officially" embedded in the arch ecosystem.
I would love to have something like nix-os, where I;
This is one of the minor reasons I like gentoo. Packages are divided into "package sets". There is a set called "selected", which is the set of explicitly installed packages. Those are recorded in a file, which is automatically modified when you install a package or remove it.
There is also package masking, where you specify packages or versions of packages to be masked. This is also managed by files. Masking would either prevent certain packages or versions of packages from being installed.
Any reason you're not using NixOS? Just curious, as I've been testing the waters with NixOS for a couple of weeks now with Arch running in a container through distrobox as a fallback and I've been enjoying it so far.
Looks nice. Can it generate a list of packages for a not-already-managed system?
Also what issues were you having with Nix?
In the readme, there's a one-liner that you can run to query pacman for everything currently installed, which you can use to bootstrap an initial config file.
I think I had many issues with nix, but the general theme of them was that you had to sort of draw the line between what was installed with nix and what was installed via Arch packages, and I never managed to find the sweet spot. There was a lot of trial-and-error and it ultimately didn't feel worth it. It didn't help that I was coming into it as a brand new nix user as well.
I was looking for something like this, I'll give it a shot !!
is it easy to switch to this from an already installed setup with several packages already? does it automatically find those packages and start from there?
In the GitHub readme there is a section on Starting Out. You can use a command to populate an initial list. Ultimately, because the tool is interactive, you can always run it to see the changes it wants to make, abort, and then tweak your config as a result.