Skip to content

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

76 points22 comments
Open on Reddit
About this post
Posted
Archived
Score
76 ยท 95% up
Kind
Text
ID
ynus51

Author

1
posts
6
comments
0
media
View profile

22 comments

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.

6 points

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.)

4 points

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?

6 points

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.

2 points

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?

3 points

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.

8 points

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;

  • describe all the packages I have installed
  • allow certain flags for certain packages passed to pacman/yay (maybe force this package to build with -j4 because -j1 is too slow but -j will blow up RAM)
  • or even ensure it's installed but hold back updates (I decided to be fancy by storing EFI in a special spot but now dkms based drivers bug out when the kernel is updated unless I do mkinitcpio manually)
  • Fire off some hooks after a specific package is installed (run steam client if steam is updated so steam games get updated to new proton maybe)
3 points

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.

4 points

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.

-1 points

Looks nice. Can it generate a list of packages for a not-already-managed system?

Also what issues were you having with Nix?

2 points

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.

1 points

I was looking for something like this, I'll give it a shot !!

2 points

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?

1 points

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.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

โ†orโ†’
Previous / next file
โ†‘orโ†“
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.