A tool that automatically converts Docker Compose projects into native NixOS configurations.
compose2nix is a command-line tool that automatically generates NixOS configuration files from existing Docker Compose projects. It converts Docker Compose service definitions into native NixOS `oci-container` configurations, solving the integration challenges of running Docker Compose stacks on NixOS systems.
NixOS users and system administrators who want to run Docker Compose-based applications with native NixOS management, and developers seeking to migrate container orchestration from Docker Compose to declarative NixOS configurations.
It provides a seamless bridge between Docker Compose's convenience and NixOS's declarative power, offering better integration, individual service management, and compatibility with NixOS secret management tools compared to manual approaches.
Generate a NixOS config from a Docker Compose project.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Converts each Docker Compose service into a systemd unit managed by NixOS, allowing individual updates and granular control over container lifecycles, as highlighted in the README's benefits section.
Works seamlessly with both Docker and Podman out of the box, giving users flexibility in choosing their container runtime without additional configuration.
Supports secure secret management through native integration with agenix and sops-nix, enabling encrypted environment files to be used in generated NixOS configurations.
Leverages the official Docker Compose library for parsing and validation, ensuring input file compatibility and error-checking 'for free', as noted in the overview.
Some Docker Compose features are not fully supported, such as Git contexts in build specifications and only short syntax for depends_on, limiting use cases for complex projects.
Known issues with systemd's UpheldBy mechanism can cause manually stopped services to be automatically restarted, complicating service management and requiring workarounds.
Requires Docker v25+ for certain features like multiple networks, forcing users to upgrade or face compatibility problems, as admitted in the known issues section.
Exclusively designed for NixOS, making it irrelevant for users on other operating systems or those not committed to the Nix ecosystem, reducing portability.