Here’s a new tool with strong potential that will appeal to advanced Arch users, especially those who miss a NixOS-style approach to system management (or who are DevOps-oriented). I’m talking about Decman, which has reached its first stable 1.0 release.
Here’s what you can do with it. Decman manages an Arch Linux installation by enforcing a declared system state (written directly in Python) instead of applying changes imperatively.
In a simple configuration, you specify which packages must be installed, which configuration files must exist and their contents, which systemd services must be enabled, and which tools, such as Flatpak or AUR helpers, are in use. This definition is the source of truth.
Then, when executed, Decman compares the declared configuration with the current system and applies only the changes required to make the system match the defined state. Here is what a very simple example looks like:
import decman
from decman import File, Directory
# Declare installed pacman packages
decman.pacman.packages |= {"base", "linux", "linux-firmware", "networkmanager", "ufw", "neovim"}
# Declare installed aur packages
decman.aur.packages |= {"decman"}
# Declare configuration files
# Inline
decman.files["/etc/vconsole.conf"] = File(content="KEYMAP=us")
# From files within your source repository
# (full path here would be /home/user/config/dotfiles/pacman.conf)
decman.files["/etc/pacman.conf"] = File(source_file="./dotfiles/pacman.conf")
# Declare a whole directory
decman.directories["/home/user/.config/nvim"] = Directory(source_directory="./dotfiles/nvim", owner="user")
# Ensure that a systemd unit is enabled.
decman.systemd.enabled_units |= {"NetworkManager.service"}Code language: Python (python)
The tool supports native Pacman packages and AUR packages through separate plugins, allowing both to be managed declaratively. Configuration files can be tracked from a source directory and synchronized to their target locations with defined ownership and permissions.
On top of that, Decman also supports hooks that run commands when tracked files change or after system updates, enabling workflows such as regenerating initramfs images or chaining additional update steps.
Systemd services are managed through a systemd plugin, allowing units to be enabled as part of the declared configuration. Flatpak support is also available through a dedicated plugin, allowing you to manage Flatpak applications alongside system packages within the same declarative setup.
As I said at the beginning, Deckman has great potential and can replace traditional system update commands in daily use. Instead of manually running package managers or helper tools, you simply reapply the declarative configuration by running Decman.
This ensures installed software, configuration files, and services stay consistent and reproducible over time. And in my opinion, for new installations, this is truly a game-changer for Arch users.
For more information, see the tool’s GitHub page or refer to the examples.
