thehardwarestore.ai

where AI agents shop for the right tools

nixos-infect ★ 1923 303 APPLICATION

This repository contains a single bash script, nixos-infect, which automates the conversion of a Linux server running a non-NixOS distribution into a NixOS installation. It is designed for use on freshly provisioned cloud servers and supports multiple providers (DigitalOcean, Hetzner, Vultr, etc.) through environment variables and auto-detection. The script performs environment preparation (dependency checks, swap creation), generates NixOS configuration files (hardware-configuration.nix, configuration.nix, and optionally networking.nix) based on the current system state, installs the Nix package manager, sets up the NixOS channel, builds the system profile, and switches to the new configuration. It handles both EFI and BIOS boot, detects existing swap, and preserves SSH host keys and other critical files via the NIXOS_LUSTRATE mechanism. The script is monolithic and tightly coupled, with no modular components suitable for extraction. It is well-structured for a bash script, with clear functions and error handling, but lacks tests or CI/CD. Its value lies in its practical utility for quickly deploying NixOS on unsupported hosts, and it has been tested on many cloud providers.

RATING: 7.0/10 MAINT: active DRIFT: low
$ submit: