Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Nix
  3. nixos-infect

nixos-infect

GPL-3.0Shell

A script to install NixOS over an existing OS on cloud VPS providers like DigitalOcean, Hetzner, and Vultr.

GitHubGitHub
1.9k stars296 forks0 contributors

What is nixos-infect?

NixOS-Infect is a Bash script that installs NixOS by overwriting the existing operating system on a cloud virtual private server (VPS). It solves the problem of cloud providers not offering NixOS images by allowing users to convert a freshly deployed Ubuntu, Debian, or other Linux instance into a NixOS system. The script automates partitioning, Nix installation, and bootloader configuration, targeting specific hosting environments.

Target Audience

DevOps engineers, system administrators, and NixOS enthusiasts who deploy servers on cloud VPS providers and want to run NixOS where it is not natively supported. It is best used on newly provisioned systems due to its destructive nature.

Value Proposition

Developers choose NixOS-Infect because it provides a simple, automated way to get NixOS running on major cloud platforms without manual installation steps. Its unique selling point is broad provider compatibility and integration with cloud-init for hands-off provisioning.

Overview

[GPLv3+] install nixos over the existing OS in a DigitalOcean droplet (and others with minor modifications)

Use Cases

Best For

  • Converting a DigitalOcean droplet to NixOS via user-data
  • Installing NixOS on Hetzner Cloud servers using cloud config
  • Replacing Ubuntu on a Vultr VPS with NixOS
  • Provisioning NixOS on Oracle Cloud Infrastructure free tier instances
  • Migrating a cloud server from a traditional Linux distribution to NixOS
  • Automating NixOS deployments on unsupported cloud providers

Not Ideal For

  • Systems with existing data or production workloads that cannot be wiped
  • Teams requiring guaranteed support for all Linux distributions, as it fails on versions like CentOS 6.9 and Ubuntu 22.10
  • Environments where automated failover and recovery are essential, since failures can leave systems inoperable

Pros & Cons

Pros

Broad Cloud Compatibility

Tested on over 20 providers including DigitalOcean, Hetzner, and Vultr, with specific cloud-init integration for automated deployment, as detailed in the README.

Automated Installation

Executable via a single curl command, handling partitioning, Nix installation, and bootloader setup without manual intervention, per the usage instructions.

Configuration Generation

Creates basic NixOS configuration files and allows importing custom Nix expressions through the NIXOS_IMPORT environment variable, enabling quick customization.

Failure Safety Mechanisms

Halts on errors to prevent inconsistent states, though the README cautions that manual recovery may still be necessary if issues arise.

Cons

High Risk of Failure

Wipes the root filesystem and can render the system inoperable if the script fails, requiring expert intervention, as warned in the README's disclaimer.

Provider-Specific Tweaks Required

For hosts like OVH and Contabo, manual adjustments such as unmounting /tmp or changing hostnames are needed, adding complexity and potential for error.

Limited OS Support

Fails on certain distributions like CentOS 6.9, CoreOS, and Ubuntu 22.10, limiting its universality and requiring users to verify compatibility.

Temporary Stopgap Solution

Admitted as a interim tool until nixos-assimilate is complete, implying potential lack of long-term maintenance and future obsolescence.

Frequently Asked Questions

Quick Stats

Stars1,875
Forks296
Contributors0
Open Issues52
Last commit2 months ago
CreatedSince 2016

Tags

#system-installation#devops#bash-script#infrastructure-as-code#nixos#provisioning#server-management

Built With

B
Bash
N
Nix

Included in

Nix5.0k
Auto-fetched 1 day ago

Related Projects

nix-installernix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.

Stars3,606
Forks96
Last commit2 days ago
nixos-anywherenixos-anywhere

Install NixOS everywhere via SSH [maintainers=@Mic92 @Lassulus @phaer @Enzime @a-kenji]

Stars3,199
Forks207
Last commit5 days ago
nixos-generatorsnixos-generators

Collection of image builders [maintainer=@Lassulus]

Stars2,401
Forks157
Last commit4 months ago
nixos-upnixos-up

The fastest NixOS install there is! 🏎️🏁

Stars254
Forks32
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub