Jump to content

在 Amazon EC2 上安裝 NixOS

From NixOS Wiki
Revision as of 19:15, 28 August 2025 by Weijia (talk | contribs) (Created page with "目前,[https://github.com/nix-community/nixos-generators nixos-generators] 项目是创建您自己的 NixOS AMI 的最佳方法。请遵循 <code>nixos-generators</code> 提供的说明,然后遵循 [https://docs.aws.amazon.com/vm-import/latest/userguide/what-is-vmimport.html AWS 提供的介绍]。")

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

公共 NixOS AMIs

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

這些 AMI 的默認用戶是 root。沒有默認密碼,而是使用在 EC2 創建過程中選擇的 SSH 密鑰進行身份驗證。

創建 NixOS AMI

目前,nixos-generators 項目是創建您自己的 NixOS AMI 的最佳方法。請遵循 nixos-generators 提供的說明,然後遵循 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.