Colmena logo

Colmena

Stateless Rust‑based NixOS deployment tool with parallel execution

Colmena provides a lightweight, stateless way to build and deploy NixOS configurations across many hosts, leveraging Rust for speed and supporting Nix Flakes, tags, and parallel operations.

Colmena banner

Overview

Overview

Colmena is a lightweight, stateless deployment utility written in Rust that acts as a thin wrapper around core Nix commands such as nix-instantiate and nix-copy-closure. It targets NixOS hosts and can reuse existing NixOps or morph configurations with minimal changes, making it a natural drop‑in for teams already familiar with those tools.

Deployment workflow

The tool builds the desired system configuration locally, then copies the resulting store paths to each target host in parallel, finally activating the new profile. It supports tag‑based host selection (--on @web), custom SSH options, and full integration with Nix Flakes via the outputs.colmenaHive attribute. Installation is straightforward through Nixpkgs (≥ 21.11), nix-shell, or a binary cache hosted on Cachix, allowing both stable and cutting‑edge versions to be used without manual compilation.

Highlights

Stateless design eliminates local state drift
Parallel deployment across multiple hosts
Native support for Nix Flakes
Compatible with existing NixOps and morph configurations

Pros

  • Fast Rust implementation leverages native Nix commands
  • Simple command‑line interface with tag filtering
  • Easy installation via Nixpkgs or binary cache
  • Works with both stable and development releases

Considerations

  • Limited to NixOS targets
  • No graphical user interface
  • Relies on proper Nix daemon configuration on hosts
  • Feature set smaller than full NixOps

Managed products teams compare with

When teams consider Colmena, these hosted platforms usually appear on the same shortlist.

Ansible logo

Ansible

IT automation and configuration management tool using simple YAML playbooks and agentless execution

Chef logo

Chef

Policy-as-code configuration & compliance automation for hybrid infrastructure

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • DevOps teams managing homogeneous NixOS fleets
  • Projects already using NixOps or morph
  • Environments that adopt Nix Flakes for reproducibility
  • Users who prefer lightweight, stateless tooling

Not ideal when

  • Mixed‑OS infrastructures requiring Windows or macOS nodes
  • Organizations needing a web‑based dashboard
  • Complex multi‑cloud orchestration beyond NixOS
  • Operators unfamiliar with Nix concepts

How teams use it

Tag‑based rollout of web services

Deploys only hosts labeled with `web`, reducing downtime and simplifying staged releases.

Upgrade Nixpkgs across a data center

Rebuilds configurations with a pinned Nixpkgs version and activates them in parallel, ensuring consistent updates.

Container‑based NixOS testing with Flakes

Creates lightweight container nodes via `boot.isContainer` and activates them automatically for CI pipelines.

Remote profile synchronization

Copies missing store paths to remote machines and replaces unknown profiles safely, keeping all nodes aligned.

Tech snapshot

Rust78%
Nix19%
Python2%
Shell1%

Tags

nixdeploymentnixos

Frequently asked questions

What prerequisites are needed to run Colmena?

A working Nix installation with the Nix daemon enabled on the control machine and SSH access to target NixOS hosts.

How does Colmena differ from NixOps?

Colmena is stateless and focuses on parallel deployment, acting as a thin wrapper around Nix commands, whereas NixOps maintains state and provides richer orchestration features.

Can Colmena be used with Nix Flakes?

Yes, define a `outputs.colmenaHive` attribute in your flake and use the standard `colmena` commands; the README includes a Flakes tutorial.

What happens if a remote host has an unknown profile?

By default Colmena replaces unknown remote profiles during `apply`; this behavior can be disabled with `deployment.replaceUnknownProfiles = false`.

Project at a glance

Active
Stars
1,949
Watchers
1,949
Forks
91
LicenseMIT
Repo age5 years old
Last commit2 weeks ago
Primary languageRust

Last synced 3 hours ago