comin
2 min read
comin is a GitOps deployment tool for NixOS machines. It runs on the target machine in pull mode, periodically polling one or more Git repositories and deploying the NixOS or nix-darwin configuration associated with that machine.
The main idea is "Git push to deploy": commit a configuration change, push it to the configured branch, and comin applies it on the next polling interval.
Features
• Pull-based NixOS and nix-darwin deployment
• Supports flake and non-flake repositories
• Can poll multiple Git remotes to avoid a single point of failure
• Supports testing branches for trying changes before promoting them
• Can create and delete system profiles
• Exposes Prometheus metrics
• Optional Git commit signature checks
NixOS module
A typical flake setup imports the comin NixOS module and configures one or more remotes:
nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
comin = {
url = "github:nlewo/comin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, comin, ... }: {
nixosConfigurations.myMachine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
comin.nixosModules.comin
{
services.comin = {
enable = true;
remotes = [{
name = "origin";
url = "https://gitlab.com/example/infra.git";
branches.main.name = "main";
}];
};
}
];
};
};
}
The service deploys the configuration matching the machine hostname.
Use Cases
• Small NixOS fleets where each host pulls and applies its own configuration
• GitOps-style infrastructure without a central deploy controller
• Machines behind NAT or firewalls where push-based deployment is inconvenient
• Testing NixOS configuration changes from separate branches