https://github.com/nixval/declarch
Declarative arch packages manager like nix way
https://github.com/nixval/declarch
archlinux kdl nix package-manager rust
Last synced: about 1 month ago
JSON representation
Declarative arch packages manager like nix way
- Host: GitHub
- URL: https://github.com/nixval/declarch
- Owner: nixval
- License: mit
- Created: 2025-11-14T01:00:45.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-16T08:51:31.000Z (about 1 month ago)
- Last Synced: 2026-02-16T15:33:25.212Z (about 1 month ago)
- Topics: archlinux, kdl, nix, package-manager, rust
- Language: Rust
- Homepage:
- Size: 5.33 MB
- Stars: 9
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# declarch
> **Declarative Package Manager for Linux**
Define your packages once in config files, then sync your system with one command.
---
## Installation
### Arch Linux (AUR)
```bash
paru -S declarch
```
### Any Linux (Binary)
```bash
curl -sSL https://raw.githubusercontent.com/nixval/declarch/v0.5.1/install.sh | sh
```
Or manual:
```bash
wget https://github.com/nixval/declarch/releases/download/v0.5.1/declarch-x86_64-unknown-linux-gnu.tar.gz
tar xzf declarch-x86_64-unknown-linux-gnu.tar.gz
sudo install declarch /usr/local/bin/
```
### From Source
```bash
cargo install declarch --git https://github.com/nixval/declarch
```
---
## Quick Start
```bash
# Initialize config
declarch init
# Add packages
declarch install bat fzf ripgrep
# Sync system
declarch sync
```
---
## Configuration
Your config lives in `~/.config/declarch/`:
```
~/.config/declarch/
├── declarch.kdl # Main config
├── state.json # Installed packages
└── modules/ # Package modules
├── base.kdl
├── gaming.kdl
└── work.kdl
```
### Example Config
```kdl
// modules/base.kdl
packages {
bat # Better cat
fzf # Fuzzy finder
ripgrep # Fast grep
fd # Better find
}
// Environment variables
env "EDITOR" {
nvim
}
// Different package managers
packages:flatpak {
com.spotify.Client
}
packages:npm {
nodejs
}
```
---
## Common Commands
```bash
# Add packages to config
declarch install
# Install specific backend
declarch install npm:nodejs
# Install to specific module
declarch install firefox --module browsers
# Sync system (install/remove packages)
declarch sync
# Sync with system update
declarch sync --update
# Show installed packages
declarch info
# Preview changes
declarch sync --dry-run
```
---
## Features
- **Declarative** - Define packages in KDL files
- **Multi-Backend** - AUR, Flatpak, npm, yarn, pnpm, bun, pip, cargo, brew
- **Modular** - Organize packages by purpose (base, gaming, work, etc.)
- **Cross-Distro** - Works on Arch, Debian, Fedora, and more
- **Git-Friendly** - Track configs in version control
---
## Cross-Distribution
| Backend | Arch | Debian | Fedora |
|---------|------|--------|--------|
| AUR | ✓ | ✗ | ✗ |
| Flatpak | ✓ | ✓ | ✓ |
| npm | ✓ | ✓ | ✓ |
| Custom | ✓ | ✓ | ✓ |
For custom backends (nala, dnf, zypper, etc.), see [Cross-Distribution Support](https://nixval.github.io/declarch/cross-distro-support.html).
---
## Documentation
- **[Full Documentation](https://nixval.github.io/declarch/)** - Complete guide
- **[Getting Started](https://nixval.github.io/declarch/getting-started/quick-start.html)** - Detailed setup
- **[All Commands](https://nixval.github.io/declarch/commands/)** - Command reference
---
## License
MIT - see [LICENSE](LICENSE)