Skip to main content

Simple declarative package management

For Arch Linux

List the packages you want installed in /etc/decpac.conf. Run decpac and packages will be installed/uninstalled until the set of installed packages matches the list. This doesn't manage config files, cache files, other generated files, etc. If you like this but want more rigorous declarative package management check out Nix and NixOS.

I've been using it for a couple months now (April 2018).

Why declarative management?
  1. You want to install the same packages on a different system. Just copy decpac.conf over and run decpac!
  2. You're looking for a program that does X, and there are 10 programs that say they do X. If you install them all, you'll definitely forget to uninstall them. Install them using pacman directly and decpac will uninstall them the next time you run it.
  3. You're trying to clean up your system but you don't remember why you installed a package, or even what it does. Organize and annotate your decpac.conf with comments!
  4. Help me out here.
  5. Diff your package list!

Usage

Install with

pip install decpac

If you don't have a configuration file, create one with

sudo decpac generate

Edit your /etc/decpac.conf (be careful not to delete system files) (see Config file syntax below).

Then run

decpac

to synchronize your packages.

Config file syntax

The config file looks like:

{
        install_main: [
                sudo,
                pacman,
                --noconfirm,
                -S,
        ],
        install_aur: [
                trizen,
                --noconfirm,
                -S,
        ],
        installed: [
                nvidia,
                lib32-nvidia-utils,
                trizen,
		...

                * audio *
                alsa-utils,
                (aur) alsaequal,
                alsaequal-mgr,
                alsaplayer,
		...
	],
},

This is a luxem file, which is like JSON but quotes are optional for single words and you can add comments like * this is a comment *.

(aur) specifies an AUR package. It's installed with whatever helper you specified in install_aur (trizen worked for me).

Implementation notes

Most AUR helpers had issues, such as installing all deps from AUR or not flagging dependencies as dependencies (or rather, flagging them all as explicit). I worked around that somewhat but it would be nice to implement AUR functionality directly. It may make things more efficient too.

Customizing AUR builds makes things nonreproducible so I avoid doing that. Specifying customizations in decpac.conf might be a good feature.

It would be awesome if decpac could install Ruby/Node packages as well using npm2arch and its ilk.

Renamed packages need to be renamed in the config manually. decpac could update the config file automatically but de/reserializing deletes comments. Maybe making a (comment) type would work?

Related projects

  • Nix - A strict declarative package (and config) manager that can be used on Arch, and also the basis of Linux distro NixOS
  • aconfmgr - A declarative Arch-native package and config manager

Metadata

Release files for decpac 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decpac 0.0.9
File Size Uploaded Provenance Actions
decpac-0.0.9.tar.gz 5.4 kB Without provenance Details for decpac-0.0.9.tar.gz

Release files / decpac-0.0.9.tar.gz

Download URL decpac-0.0.9.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
134afb9103b3c04ad836acd9895b7cd2a3772cefe491549881b3c5d72ac70d05
BLAKE2b-256 checksum
How to use checksums
03bb0353d3233fc2c527bf797cd19171ed891a54ccf23bd6fa4502c27705158b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.3

Security for decpac 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page