2025-12-24 08:54:24 +02:00
# curator - A Home-Manager Like Tool for Fedora
2025-11-19 22:42:28 +05:30
2025-12-24 07:56:11 +02:00
A lightweight Python CLI (managed with `uv` ) for Fedora that provides COPR repository management, dotfile management and package installation functionality through a centralized TOML configuration.
2025-11-19 22:42:28 +05:30
## Overview
2025-12-24 08:54:24 +02:00
curator is a Python CLI that helps you manage your Fedora system configuration by:
2025-11-21 20:22:02 +05:30
- Managing COPR repositories (enable/disable automatically)
2025-11-19 22:42:28 +05:30
- Installing and managing system packages via dnf
2025-11-21 19:45:32 +05:30
- Managing dotfiles through symlinks to actual files
2025-12-24 08:54:24 +02:00
- Centralized configuration via a single `inventory.toml` file
2025-11-21 19:45:32 +05:30
- User-level configuration similar to home-manager/nixos
- Automatic backup of existing files before replacement
2025-11-19 22:42:28 +05:30
## Installation
2025-12-24 07:56:11 +02:00
1. Clone or download this repository.
2. Install dependencies with `uv` (none beyond the standard library, but this sets up the venv):
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 07:56:11 +02:00
uv sync
2025-11-19 22:42:28 +05:30
```
2025-12-24 07:56:11 +02:00
3. Run with `uv` :
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 08:54:24 +02:00
uv run curator --help
2025-12-24 07:56:11 +02:00
```
4. Or use the local shim directly:
```bash
2025-12-24 08:54:24 +02:00
./curator --help
2025-12-24 07:56:11 +02:00
```
5. Optionally install globally via `uv` :
```bash
uv tool install .
2025-11-19 22:42:28 +05:30
```
## Quick Start
```bash
# Initialize the configuration structure
2025-12-24 08:54:24 +02:00
uv run curator init
2025-11-19 22:42:28 +05:30
2025-11-21 19:45:32 +05:30
# Edit the configuration file to add packages and dotfiles
2025-12-24 08:54:24 +02:00
nano ~/.config/curator/inventory.toml
2025-11-19 22:42:28 +05:30
# Apply configuration
2025-12-24 08:54:24 +02:00
uv run curator switch
2025-11-21 19:45:32 +05:30
# Check status
2025-12-24 08:54:24 +02:00
uv run curator status
2025-11-19 22:42:28 +05:30
```
2025-12-24 08:54:24 +02:00
You can swap `uv run curator ...` for `./curator ...` if you prefer the local shim.
2025-12-24 07:56:11 +02:00
2025-11-19 22:42:28 +05:30
## Commands
### `init`
2025-12-24 08:54:24 +02:00
Initialize the configuration structure and create `inventory.toml` .
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 08:54:24 +02:00
uv run curator init
# or ./curator init
2025-11-19 22:42:28 +05:30
```
Creates:
2025-12-24 08:54:24 +02:00
- `~/.config/curator/` - Main configuration directory
- `~/.config/curator/inventory.toml` - Central configuration file
2025-11-19 22:42:28 +05:30
### `switch`
2025-12-24 08:54:24 +02:00
Apply the current configuration (enable COPR, install packages, deploy dotfiles). Use `--rollback` to restore the previous `inventory.toml` snapshot before applying.
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 08:54:24 +02:00
uv run curator switch
# or ./curator switch
# rollback to the previous inventory.toml and apply it
uv run curator switch --rollback
2025-11-19 22:42:28 +05:30
```
This command:
2025-12-24 08:54:24 +02:00
1. Enables all COPR repositories listed in `inventory.toml`
2025-11-21 20:22:02 +05:30
2. Disables COPR repositories that are no longer configured
2025-12-24 08:54:24 +02:00
3. Installs all packages listed in `inventory.toml`
2025-11-21 20:22:02 +05:30
4. Creates symlinks for all configured dotfiles
5. Creates backups of existing files before replacing them
6. Updates the last switch timestamp
2025-11-19 22:42:28 +05:30
### `status`
2025-11-21 19:45:32 +05:30
Show current configuration status and information.
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 08:54:24 +02:00
uv run curator status
# or ./curator status
2025-11-19 22:42:28 +05:30
```
Displays:
- Configuration directory paths
- Last switch timestamp
2025-11-21 20:22:02 +05:30
- List of configured COPR repositories, packages and dotfiles
2025-11-19 22:42:28 +05:30
### `help`
Show help message with all available commands.
```bash
2025-12-24 08:54:24 +02:00
uv run curator help
# or ./curator help
2025-11-19 22:42:28 +05:30
```
2025-11-21 19:45:32 +05:30
## Configuration
2025-12-24 08:54:24 +02:00
### inventory.toml
The central configuration file located at `~/.config/curator/inventory.toml` :
2025-11-19 22:42:28 +05:30
2025-11-20 17:17:08 +05:30
```toml
2025-12-24 08:54:24 +02:00
# curator Configuration File
2025-11-21 19:45:32 +05:30
# User-level configuration similar to home-manager/nixos
2025-12-24 08:54:24 +02:00
[curator]
2025-11-21 19:45:32 +05:30
version = "1.0"
2025-12-24 07:56:11 +02:00
last_switch = ""
2025-11-21 19:45:32 +05:30
2025-12-24 08:54:24 +02:00
[copr]
# copr.fedorainfracloud.org/username/repository
# copr.fedorainfracloud.org/anotheruser/anotherrepo
[dnf]
# git
# vim
# curl
# wget
[brew]
# wget
# coreutils
[flatpak]
# org.mozilla.firefox
# com.spotify.Client
[rpm-ostree]
# podman
# htop
[nix]
# nixpkgs#git # or just "git" (curator will prefix nixpkgs#)
# nixpkgs#htop # or just "htop"
2025-11-21 19:45:32 +05:30
[dotfiles]
# Dotfiles to manage with symlinks
# Format: "target_path" = "source_path"
# target_path: where the symlink should be created (relative to home directory)
2025-12-19 20:13:03 +05:30
# source_path: where the actual file is stored (relative to dotfiles directory)
".bashrc" = ".bashrc"
".config/vimrc" = "vimrc"
".config/alacritty/alacritty.yml" = "alacritty.yml"
2025-11-21 19:45:32 +05:30
[options]
# Additional options
backup = true
backup_dir = "backup"
```
### Configuration Sections
2025-12-24 08:54:24 +02:00
#### `[curator]`
2025-11-21 19:45:32 +05:30
- `version` : Configuration file version
- `last_switch` : Timestamp of last switch operation (auto-updated)
2025-12-24 08:54:24 +02:00
#### `[copr]`
List of COPR repositories to enable via `dnf copr enable` . **One repository per line** —presence means enable, absence means don't enable.
2025-11-21 20:22:02 +05:30
**Examples:**
```toml
2025-12-24 08:54:24 +02:00
[copr]
copr.fedorainfracloud.org/username/repository
copr.fedorainfracloud.org/anotheruser/anotherrepo
2025-11-21 20:22:02 +05:30
```
2025-12-24 08:54:24 +02:00
To remove a COPR repository, simply delete the line containing the repository name. curator will automatically disable it during the next switch.
2025-11-21 20:22:02 +05:30
2025-12-24 08:54:24 +02:00
#### `[dnf]`
List of packages to install via dnf. **One package per line** —presence means install, absence means don't install.
2025-11-21 20:01:07 +05:30
**Examples:**
```toml
2025-12-24 08:54:24 +02:00
[dnf]
git
vim
curl
wget
nodejs
npm
2025-11-21 20:01:07 +05:30
```
To remove a package, simply delete the line containing the package name.
2025-11-21 19:45:32 +05:30
2025-12-24 08:54:24 +02:00
#### `[brew]`
List of packages to install via Homebrew. **One package per line** —presence means install.
#### `[flatpak]`
List of Flatpak refs to install. **One ref per line** —presence means install.
2025-11-21 19:45:32 +05:30
#### `[dotfiles]`
Dotfile mappings using symlinks:
- **Key**: Target path where symlink should be created (relative to home directory)
2025-12-19 20:13:03 +05:30
- **Value**: Source path where actual file is stored (relative to dotfiles directory)
- Note: Source path automatically prefixed with "dotfiles/" if not present
2025-11-21 19:45:32 +05:30
#### `[options]`
Additional configuration options:
- `backup` : Enable/disable backup of existing files (default: true)
2025-12-24 08:54:24 +02:00
- `backup_dir` : Directory name for backups (relative to curator directory)
2025-11-19 22:42:28 +05:30
2025-11-21 19:45:32 +05:30
## File Structure
2025-11-19 22:42:28 +05:30
```
2025-12-24 08:54:24 +02:00
~/.config/curator/
├── inventory.toml # Main configuration file
2025-11-21 19:45:32 +05:30
├── dotfiles/ # Your actual dotfiles (source files)
│ ├── .bashrc
│ ├── vimrc
│ └── alacritty.yml
└── backup/ # Backups of replaced files
├── .bashrc.20231121_143022.bak
└── vimrc.20231121_143022.bak
2025-11-19 22:42:28 +05:30
```
2025-11-21 19:45:32 +05:30
## How It Works
2025-11-19 22:42:28 +05:30
2025-11-21 20:22:02 +05:30
### COPR Repository Management
2025-12-24 08:54:24 +02:00
COPR repositories are managed through the `[copr]` section in `inventory.toml` :
- **Add COPR repo**: Add the repository name on its own line
- **Remove COPR repo**: Remove the entry
- **Automatic cleanup**: curator automatically disables COPR repos that are removed from configuration
2025-11-21 20:22:02 +05:30
- **No flags needed**: Just presence/absence of the repository name matters
2025-12-24 08:54:24 +02:00
- curator stores the previous configuration at `~/.config/curator/inventory.toml.prev` and compares it to the current file during `switch` ; newly added repos are enabled, removed repos are disabled.
2025-11-21 20:22:02 +05:30
2025-11-21 20:01:07 +05:30
### Package Management
2025-12-24 08:54:24 +02:00
Packages are managed through the `[dnf]` section in `inventory.toml` :
- **Add package**: Add the package name on its own line
- **Remove package**: Remove the entry
2025-11-21 20:01:07 +05:30
- **No flags needed**: Just presence/absence of the package name matters
2025-12-24 08:54:24 +02:00
- The previous configuration snapshot (`inventory.toml.prev` ) is used to detect additions/removals on each `switch` ; added packages are installed and removed packages are uninstalled.
### Brew Management
Homebrew packages are managed through the `[brew]` section:
- **Add package**: Add the package name on its own line
- **Remove package**: Remove the entry
- Additions/removals are detected against `inventory.toml.prev` on `switch` ; removed packages are uninstalled.
### Flatpak Management
Flatpaks are managed through the `[flatpak]` section:
- **Add ref**: Add the ref on its own line
- **Remove ref**: Remove the entry
- Additions/removals are detected against `inventory.toml.prev` on `switch` ; removed refs are uninstalled.
### rpm-ostree Management
rpm-ostree packages are managed through the `[rpm-ostree]` section:
- **Add package**: Add the package name on its own line
- **Remove package**: Remove the entry
- Additions/removals are detected against `inventory.toml.prev` on `switch` ; removed packages are uninstalled.
### Nix Management
Nix packages are managed through the `[nix]` section (if `nix` is available on the system):
- **Add package**: Add the package name (e.g., `nixpkgs#git` or just `git` ) on its own line
- **Remove package**: Remove the entry
- Additions/removals are detected against `inventory.toml.prev` on `switch` ; installs/removals use `nix profile` and will prefix `nixpkgs#` if missing.
2025-11-21 20:01:07 +05:30
2025-11-21 19:45:32 +05:30
### Dotfile Management
2025-12-24 08:54:24 +02:00
curator uses symlinks to manage dotfiles:
1. Your actual dotfiles are stored in `~/.config/curator/dotfiles/`
2025-12-19 20:13:03 +05:30
2. Symlinks are created from your home directory to these files using relative paths
2025-11-21 19:45:32 +05:30
3. This allows you to version control your dotfiles in one place
4. Changes to the source files are immediately reflected in your home directory
2025-12-19 20:13:03 +05:30
5. Source paths are automatically prefixed with "dotfiles/" for convenience
2025-11-19 22:42:28 +05:30
### Backup System
2025-12-24 08:54:24 +02:00
Before creating symlinks, curator:
2025-11-21 19:45:32 +05:30
1. Checks if the target file exists and is not a symlink
2. Creates a timestamped backup in the backup directory
3. Removes the original file
4. Creates the symlink to your managed dotfile
2025-11-19 22:42:28 +05:30
2025-12-24 08:54:24 +02:00
`inventory.toml` is also backed up before the last switch timestamp is updated.
2025-12-24 07:56:11 +02:00
2025-12-24 08:54:24 +02:00
The previously applied configuration is stored separately as `~/.config/curator/inventory.toml.prev` to compute diffs for COPR and package changes.
2025-12-24 07:56:11 +02:00
2025-11-19 22:42:28 +05:30
## Examples
### Basic Setup
```bash
2025-12-24 08:54:24 +02:00
# Initialize curator
uv run curator init
# Edit inventory.toml to add COPR repos and packages
nano ~/.config/curator/inventory.toml
# Add to the sections:
# [copr]
# copr.fedorainfracloud.org/username/cool-repo
# [dnf]
# git
# vim
# curl
# [brew]
# wget
# [flatpak]
# org.mozilla.firefox
# [rpm-ostree]
# podman
# [nix]
# nixpkgs#git (or just "git")
2025-11-21 20:01:07 +05:30
# Create your dotfiles directory and add files
2025-12-24 08:54:24 +02:00
mkdir -p ~/.config/curator/dotfiles
echo "export EDITOR=vim" > ~/.config/curator/dotfiles/.bashrc
2025-11-21 19:45:32 +05:30
# Add to [dotfiles] section:
2025-12-19 20:13:03 +05:30
".bashrc" = ".bashrc"
2025-11-19 22:42:28 +05:30
# Apply configuration
2025-12-24 08:54:24 +02:00
uv run curator switch
2025-11-19 22:42:28 +05:30
```
2025-11-21 19:45:32 +05:30
### Managing Application Configurations
2025-11-19 22:42:28 +05:30
```bash
2025-11-21 19:45:32 +05:30
# Add alacritty configuration
2025-12-24 08:54:24 +02:00
mkdir -p ~/.config/curator/dotfiles
cp ~/.config/alacritty/alacritty.yml ~/.config/curator/dotfiles/
2025-11-21 19:45:32 +05:30
2025-12-24 08:54:24 +02:00
# Edit inventory.toml
nano ~/.config/curator/inventory.toml
2025-11-19 22:42:28 +05:30
2025-11-21 19:45:32 +05:30
# Add to [dotfiles] section:
2025-12-19 20:13:03 +05:30
".config/alacritty/alacritty.yml" = "alacritty.yml"
2025-11-19 22:42:28 +05:30
# Apply changes
2025-12-24 08:54:24 +02:00
uv run curator switch
2025-11-19 22:42:28 +05:30
```
2025-11-21 20:22:02 +05:30
### COPR Repository Management Examples
```toml
2025-12-24 08:54:24 +02:00
[copr]
# Development tools COPR
copr.fedorainfracloud.org/development/tools
copr.fedorainfracloud.org/user/neovim-nightly
2025-12-24 07:56:11 +02:00
# To remove a COPR repo, just delete the entry
2025-12-24 08:54:24 +02:00
# curator will automatically disable it during the next switch
2025-11-21 20:22:02 +05:30
```
2025-11-21 20:01:07 +05:30
### Package Management Examples
```toml
2025-12-24 08:54:24 +02:00
[dnf]
# Development tools
git
vim
nodejs
npm
# System utilities
curl
wget
tree
htop
2025-12-24 07:56:11 +02:00
# To remove a package, just delete the entry
2025-12-24 08:54:24 +02:00
[brew]
# Utilities and tools
wget
coreutils
[flatpak]
org.mozilla.firefox
com.spotify.Client
[rpm-ostree]
podman
htop
2025-11-21 20:01:07 +05:30
```
2025-11-21 19:45:32 +05:30
### Version Control Your Configuration
2025-11-19 22:42:28 +05:30
```bash
2025-12-24 08:54:24 +02:00
# Initialize git repository in curator directory
cd ~/.config/curator
2025-11-21 19:45:32 +05:30
git init
git add .
git commit -m "Initial configuration"
# Now you can version control your entire system configuration
2025-12-24 08:54:24 +02:00
git add inventory.toml dotfiles/
2025-11-21 19:45:32 +05:30
git commit -m "Updated vim configuration"
2025-11-19 22:42:28 +05:30
```
2025-11-21 19:45:32 +05:30
## Environment Variables
2025-11-19 22:42:28 +05:30
2025-12-24 08:54:24 +02:00
- `CURATOR_DIR` : Override the default configuration directory (default: `~/.config/curator` )
2025-11-21 19:45:32 +05:30
## Dependencies
2025-12-24 07:56:11 +02:00
- Python 3.11+
- `uv` for environment and script management
2025-11-21 19:45:32 +05:30
- `dnf` - Fedora package manager
2025-11-21 20:22:02 +05:30
- `dnf-plugins-core` - For COPR repository management
2025-11-21 19:45:32 +05:30
## Migration from Previous Version
2025-12-24 08:54:24 +02:00
If you were using the old version of curator with `git = true` or bare keys under `[packages]` /`[copr]` :
2025-11-21 19:45:32 +05:30
2025-12-24 07:56:11 +02:00
1. Your existing configuration will not be automatically migrated, but the CLI will still read the legacy format.
2025-12-24 08:54:24 +02:00
2. Run `uv run curator init` (or `./curator init` ) to create the new `inventory.toml` structure.
3. Convert to section-per-line format:
2025-11-21 20:01:07 +05:30
```toml
2025-12-24 07:56:11 +02:00
# Old formats
2025-12-24 08:54:24 +02:00
[dnf]
2025-11-21 20:01:07 +05:30
git = true
vim = true
2025-12-24 07:56:11 +02:00
# or
2025-12-24 08:54:24 +02:00
[dnf]
2025-11-21 20:01:07 +05:30
git
vim
2025-12-24 07:56:11 +02:00
# New format
2025-12-24 08:54:24 +02:00
[dnf]
git
vim
[copr]
copr.fedorainfracloud.org/username/repository
2025-11-21 20:01:07 +05:30
```
2025-12-24 08:54:24 +02:00
4. Move your existing dotfiles from the old directory to `~/.config/curator/dotfiles/`
2025-11-19 22:42:28 +05:30
## License
2025-12-24 07:56:11 +02:00
This project is open source. Feel free to contribute or report issues.