Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

colmena

> DevOps
Open source

A simple, stateless NixOS deployment tool [maintainer=@zhaofengli, @stepbrobd, @NickCao]

2.3K stars0 likes0 views
WebsiteGitHub

About

A simple, stateless NixOS deployment tool [maintainer=@zhaofengli, @stepbrobd, @NickCao]

Colmena

Colmena is a simple, stateless NixOS deployment tool modeled after NixOps and morph, written in Rust. It's a thin wrapper over Nix commands like nix-instantiate and nix-copy-closure, and supports parallel deployment.

Now with 100% more flakes! See Tutorial with Flakes below.


$ colmena apply --on @tag-a
[INFO ] Enumerating nodes...
[INFO ] Selected 7 out of 45 hosts.
  (...) ✅ 0s Build successful
  sigma  7s copying path '/nix/store/h6qpk8rwm3dh3zsl1wlj1jharzf8aw9f-unit-haigha-agent.service' to 'ssh://[email protected]'...
  theta ✅ 7s Activation successful
  gamma  8s Starting...
  alpha ✅ 1s Activation successful
epsilon  7s copying path '/nix/store/fhh4rfixny8b21l6jqzk7nqwxva5k20h-nixos-system-epsilon-20.09pre-git' to 'ssh://[email protected]'...
   beta  7s removing obsolete file /boot/kernels/z28ayg10kpnlrz0s2qrb9pzv82lc20s2-initrd-linux-5.4.89-initrd
  kappa ✅ 2s Activation successful

Installation

colmena is included in Nixpkgs beginning with 21.11.

Use the following command to enter a shell environment with the colmena command:

bash
nix-shell -p colmena

Unstable Version

To install the latest development version to your user profile:

bash
nix-env -if https://github.com/zhaofengli/colmena/tarball/main

Alternatively, if you have a local clone of the repo:

bash
nix-env -if default.nix

A public binary cache is available at https://colmena.cachix.org, courtesy of Cachix. This binary cache contains unstable versions of Colmena built by GitHub Actions.

Tutorial

See Tutorial with Flakes for usage with Nix Flakes.

Colmena should work with your existing NixOps and morph configurations with minimal modification. Here is a sample hive.nix with two nodes, with some common configurations applied to both nodes:

…

The full set of options can be found in the manual. Run colmena build in the same directory to build the configuration, or do colmena apply to build and deploy it to all nodes.

Tutorial with Flakes

To use with Nix Flakes, create outputs.colmenaHive in your flake.nix.

Here is a short example:

…

The full set of options can be found in the manual. Run colmena build in the same directory to build the configuration, or do colmena apply to build and deploy it to all nodes.

Migrating to Direct Flake Evaluation

error: flake 'git+file:///path/to/flake' does not provide attribute 'packages.x86_64-linux.colmenaHive', 'legacyPackages.x86_64-linux.colmenaHive' or 'colmenaHive'

Colmena now uses nix eval to evaluate flakes. Your flake needs to depend on Colmena itself as an input and expose a new output called colmenaHive:

diff
 {
   inputs = {
+    # ADDED: Colmena input
+    colmena.url = "github:zhaofengli/colmena";

     # ... Rest of configuration ...
   };
   outputs = { self, colmena, ... }: {
+    # ADDED: New colmenaHive output
+    colmenaHive = colmena.lib.makeHive self.outputs.colmena;

     # Your existing colmena output
     colmena = {
       # ... Rest of configuration ...
     };
   };
 }

Manual

Read the Colmena Manual.

Environment Variables

  • SSH_CONFIG_FILE: Path to a ssh_config file

Current Limitations

  • It's required to use SSH keys to log into the remote hosts, and interactive authentication will not work.
  • Error reporting is lacking.

Licensing

Colmena is available under the MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustdeploymentnixnixos

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理