How to contribute

June 24, 2026 · View on GitHub

Create a new issue using the correct issue template or introduce a new feature/fix a bug and submit a pull request.

Catnap uses Semantic Versioning, make sure to bump the version respectively.

To bump the version, use the versionctl tool which can be generated using:

# Generate versionctl tool
$ nim generate_versionctl

# List usage of versionctl tool
$ versionctl

Project structure

.
├── config/
│   ├── config.cat   # Main config (DSL)
│   ├── distros.cat  # Distro art config (DSL)
│   └── themes/      # Example themes
├── docs/  # Contains man docs
├── image/ # Contains all images for README.md
├── src/
│   ├── common/     # Layer 1 => no internal deps, imports stdlib only
│   ├── config/     # Layer 2 => depends on: common
│   │   └── dsl/    # Custom config DSL (Domain-Specific Config Language)
│   ├── system/     # Layer 3 => depends on: common, config
│   ├── generation/ # Layer 4 => depends on: common, config, system
│   ├── rendering/  # Layer 5 => depends on: common, config, system, generation
│   ├── extern/
│   │   └── headers/ # C headers
│   └── catnap.nim  # Entry point
├── scripts/     # Test scripts
└── config.nims  # nim install, nim debug, ...

Module layer rules

The src/ tree is divided into strict dependency layers. A module may only import from its own layer or lower, importing upward is forbidden.

LayerPackageMay import
1common/stdlib only
2config/common
3system/common, config
4generation/common, config, system
5rendering/common, config, system, generation

How to add a new distro

  1. Add the distro's art block in config/distros.cat, inside the $distros list. Keep entries in alphabetical order. Use {%name ["line1" ...] margin=[top left right]} — multiple names for aliases: {%mint %linuxmint [...]}.
  2. In src/common/definitions.nim, add an entry to PKGMANAGERS:
"distroname": "pkgmanager",
  1. If the package manager is new, also add it to PKGCOUNTCOMMANDS in the same file:
"pkgmanager": "command to count installed packages",
  1. Submit a pull request to the Catnap repo.