{"id":13478834,"url":"https://github.com/nix-community/nixos-anywhere","last_synced_at":"2025-05-14T04:09:34.593Z","repository":{"id":62995252,"uuid":"563831285","full_name":"nix-community/nixos-anywhere","owner":"nix-community","description":"Install NixOS everywhere via SSH [maintainers=@Mic92, @Lassulus, @phaer, @Enzime]","archived":false,"fork":false,"pushed_at":"2025-05-07T20:55:18.000Z","size":2586,"stargazers_count":2103,"open_issues_count":72,"forks_count":149,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-07T21:39:16.843Z","etag":null,"topics":["build-with-buildbot","deployment","nix","nixos"],"latest_commit_sha":null,"homepage":"https://nix-community.github.io/nixos-anywhere/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nix-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"nix-community"}},"created_at":"2022-11-09T12:36:38.000Z","updated_at":"2025-05-07T20:55:21.000Z","dependencies_parsed_at":"2024-02-22T00:27:35.742Z","dependency_job_id":"efe292b9-9a22-4c83-8935-2ee79bc00832","html_url":"https://github.com/nix-community/nixos-anywhere","commit_stats":{"total_commits":448,"total_committers":62,"mean_commits":7.225806451612903,"dds":0.5,"last_synced_commit":"3fb834da466b75300a9141f9a68869c56fbd28f3"},"previous_names":["nix-community/nixos-anywhere"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnixos-anywhere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnixos-anywhere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnixos-anywhere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnixos-anywhere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-community","download_url":"https://codeload.github.com/nix-community/nixos-anywhere/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253824723,"owners_count":21970065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-with-buildbot","deployment","nix","nixos"],"created_at":"2024-07-31T16:02:04.178Z","updated_at":"2025-05-14T04:09:29.579Z","avatar_url":"https://github.com/nix-community.png","language":"Shell","funding_links":["https://opencollective.com/nix-community"],"categories":["Shell","By Language","Recently Updated","deployment","Installation Media"],"sub_categories":["Shell","[Sep 15, 2024](/content/2024/09/15/README.md)","Discovery"],"readme":"# nixos-anywhere\n\n**_Install NixOS everywhere via ssh_**\n\n\u003cimg src=\"https://raw.githubusercontent.com/nix-community/nixos-anywhere/main/docs/logo.png\" width=\"150\" height=\"150\"\u003e\n\n[Documentation Index](docs/INDEX.md)\n\n## README\n\nSetting up a new machine is time-consuming, and becomes complicated when it\nneeds to be done remotely. If you're installing NixOS, the **nixos-anywhere**\ntool allows you to pre-configure the whole process including:\n\n- Disk partitioning and formatting\n- Configuring and installing NixOS\n- Installing additional files and software\n\nYou can then initiate an unattended installation with a single CLI command.\nSince **nixos-anywhere** can access the new machine using SSH, it's ideal for\nremote installations.\n\nOnce you have initiated the command, there is no need to 'babysit' the\ninstallation. It all happens automatically.\n\nYou can use the stored configuration to repeat the same installation if you need\nto.\n\n## Overview\n\nIf you have machines on a mix of platforms, you'll need a common installation\nsolution that works anywhere. **nixos-anywhere** is ideal in this situation.\n\n**nixos-anywhere** can be used equally well for cloud servers, bare metal\nservers such as Hetzner, and local servers accessible via a LAN. You can create\nstandard configurations, and use the same configuration to create identical\nservers anywhere.\n\nYou first create Nix configurations to specify partitioning, formatting and\nNixOS configurations. Further options can be controlled by a flake and by\nrun-time switches.\n\nOnce the configuration has been created, a single command will:\n\n- Connect to the remote server via SSH\n- Detect whether a NixOS installer is present; if not, it will use the Linux\n  `kexec` tool to boot into a Nixos installer.\n- Use the [disko](https://github.com/nix-community/disko) tool to partition and\n  format the hard drive\n- Install NixOS\n- Optionally install any Nix packages and other software required.\n- Optionally copy additional files to the new machine\n\nIt's also possible to use **nixos-anywhere** to simplify the installation on a\nmachine that has no current operating system, first booting from a NixOS\ninstaller image. This feature is described in the\n[how-to guide](./docs/howtos/no-os.md#installing-on-a-machine-with-no-operating-system).\nIt's useful because you can pre-configure your required software and\npreferences, and build the new machine with a single command.\n\n**Important Note:** Never use a production server as the target. It will be\ncompletely overwritten and all data lost. This tool should only be used for\ncommissioning a new computer or repurposing an old machine once all important\ndata has been migrated.\n\n## Prerequisites\n\n- Source Machine:\n\n  - Can be any machine with Nix installed, e.g. a NixOS machine.\n\n- Target Machine:\n\n  - Unless you're using the option to boot from a NixOS installer image, or\n    providing your own `kexec` image, it must be running x86-64 Linux with kexec\n    support. Most `x86_64` Linux systems do have kexec support. By providing\n    your own [image](./docs/howtos/custom-kexec.md#using-your-own-kexec-image)\n    you can also perform kexec for other architectures eg aarch64\n  - The machine must be reachable over the public internet or local network.\n    Nixos-anywhere does not support wifi networks. If a VPN is needed, define a\n    custom installer via the --kexec flag which connects to your VPN.\n  - When `kexec` is used the target must have at least 1 GB of RAM, excluding\n    swap.\n\n## How to use nixos-anywhere\n\nThe [Quickstart Guide](./docs/quickstart.md) gives more information on how to\nrun **nixos-anywhere** in its simplest form. For more specific instructions to\nsuit individual requirements, see the [How To Guide](./docs/howtos/INDEX.md).\n\n## Related Tools\n\n**nixos-anywhere** makes use of the\n[disko](https://github.com/nix-community/disko) tool to handle the partitioning\nand formatting of the disks.\n\n## Contact\n\nFor questions, come join us in the\n[nixos-anywhere](https://matrix.to/#/#nixos-anywhere:nixos.org) matrix room.\n\n## Licensing and Contribution details\n\nThis software is provided free under the\n[MIT License](https://opensource.org/licenses/MIT).\n\n---\n\nThis project is supported by [Numtide](https://numtide.com/).\n![Untitledpng](https://codahosted.io/docs/6FCIMTRM0p/blobs/bl-sgSunaXYWX/077f3f9d7d76d6a228a937afa0658292584dedb5b852a8ca370b6c61dabb7872b7f617e603f1793928dc5410c74b3e77af21a89e435fa71a681a868d21fd1f599dd10a647dd855e14043979f1df7956f67c3260c0442e24b34662307204b83ea34de929d)\n\nWe are a team of independent freelancers that love open source.  We help our\ncustomers make their project lifecycles more efficient by:\n\n- Providing and supporting useful tools such as this one\n- Building and deploying infrastructure, and offering dedicated DevOps support\n- Building their in-house Nix skills, and integrating Nix with their workflows\n- Developing additional features and tools\n- Carrying out custom research and development.\n\n[Contact us](https://numtide.com/contact) if you have a project in mind, or if\nyou need help with any of our supported tools, including this one. We'd love to\nhear from you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnixos-anywhere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-community%2Fnixos-anywhere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnixos-anywhere/lists"}