What are good ways to replicate a Linux setup across different computers?
Asked by
MellowCedar42
I use several Linux distributions and like how NixOS lets me describe my system in a configuration file, such as /etc/nixos/configuration.nix. That makes it easy to install software and reproduce the same setup on another machine by copying the configuration. Are there comparable tools or approaches for Debian-, RPM-, or Arch-based distributions?
Answers
There isn't one universal tool that works exactly like the NixOS configuration system on every other distribution. Provisioning tools such as Ansible, Kickstart, and shell scripts can provide similar results, depending on whether you want to configure an existing system or automate installation from scratch.
Reply to this answer
GNU Guix offers a similar declarative approach, although it is its own distribution and is not based on Debian, RPM, or Arch. For more conventional distributions, people often combine installation scripts with configuration management tools.
Reply to this answer
If you don't need an exact recreation of the whole system, a simple approach is to export or record the list of installed packages in a text file and use that as a reference when setting up another computer.
Reply to this answer
Ansible is probably the closest practical option. You can write playbooks describing the packages, configuration files, services, and other setup steps, then apply them to another machine.
Reply to this answer
You can install Nix itself on many different distributions, so you may be able to keep using Nix for reproducible package and development environments without switching the entire operating system.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowCedar42: That makes sense. It isn't exactly the same model as NixOS, but Ansible seems practical enough, and it worked well for setting up an Arch system.