dek-0.1.15 is not a library.
dek
Declarative environment setup. One TOML, any machine.
Install
# or
# setup completions
Usage
Config
# Packages
[] # auto-detects: pacman, apt, dnf, brew
= ["curl", "git", "htop"]
[]
= ["bat", "eza", "ripgrep"]
[]
= ["github.com/junegunn/fzf@latest"]
[]
= ["prettier", "typescript"]
[]
= ["httpie", "tldr"]
# Systemd services
[[]]
= "docker"
= "active"
= true
# Files
[]
= "~/.zshrc"
[]
= "~/.config/nvim"
[]
= ["export PATH=$HOME/.local/bin:$PATH"]
# Shell
[]
= "ls -larth"
[]
= "nvim"
# Custom commands
[[]]
= "setup-db"
= "psql -c 'SELECT 1 FROM pg_database WHERE datname=mydb'"
= "createdb mydb"
# Assertions
[[]]
= "docker --version"
= "Docker version 2[0-9]"
[[]]
= "test -f /etc/hosts"
Split Config
dek/
├── 00-packages.toml
├── 10-services.toml
├── 20-dotfiles.toml
└── optional/
└── extra.toml # only applied when explicitly requested
Files merged alphabetically. Use dek apply extra to include optional configs.
Run Commands
Define reusable commands:
[]
= "Deploy the application"
= ["os.rsync"]
= "rsync -av ./dist/ server:/var/www/"
[]
= "Backup database"
= "scripts/backup.sh" # relative to config dir
Remote
Apply to remote hosts via SSH:
Multi-host with Inventory
# inventory.toml
= ["web-01", "web-02", "web-03", "db-master"]
Shows matched hosts and prompts for confirmation before applying.
Deploy Workflow
For build-and-deploy workflows:
# Local build step (runs before remote)
[]
= true
= "mvn package -DskipTests"
# Include build artifacts
[]
= "artifacts/app.jar"
# Deploy to remote
[]
= "/opt/app/app.jar"
[[]]
= "app"
= "active"
# 1. Runs build locally
# 2. Includes fresh jar
# 3. Ships to all app-* hosts
# 4. Copies jar, restarts service
Inline
Quick installs without a config file:
Test
Spin up a container to test your config:
Bake
Embed config into a standalone binary:
Package:Binary Syntax
When package and binary names differ:
[]
= ["ripgrep:rg", "fd-find:fd", "bottom:btm"]
Installs ripgrep, checks for rg in PATH.