Jump to content

在 Amazon EC2 上安裝 NixOS

From Official NixOS Wiki
Revision as of 19:14, 28 August 2025 by Weijia (talk | contribs) (Created page with "AWS 上可用的 NixOS AMI 列表位于 [https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/amazon-ec2-amis.nix 此处],更新的列表位于:[https://nixos.github.io/amis/ 此处](参见 [https://discourse.nixos.org/t/ami-for-nixos-23-11/36860/7 此讨论线程])。")

Amazon EC2 是一個廣泛使用的雲部署平台,隸屬於亞馬遜網絡服務 (AWS)。NixOS 主要通過 AMI 和 nixos-generators 項目支持該平台。

公共 NixOS AMIs

AWS 上可用的 NixOS AMI 列表位於 此處,更新的列表位於:此處(參見 此討論線程)。

The default user for these AMI's is root. There isn't a default password, instead authentication is done by using the SSH key selected during the EC2 creation process.

Creating a NixOS AMI

The nixos-generators project is currently the best method to create your own NixOS AMI. Follow the directions provided by nixos-generators & then follow the instructions provided by AWS.

Additional Resources

Troubleshooting

SSH Asks For Password

When connecting to a newly launched EC2 instance via SSH, it may ask for a password. This seems to be because the amazon-init systemd service is still reading user data. Back out of the current SSH attempt and try again in a few minutes.