From e437989739c52c589c86067c9d52e1fa6437a695 Mon Sep 17 00:00:00 2001 From: Maurice Zhou Date: Sun, 19 Mar 2023 10:54:16 +0100 Subject: [PATCH] NixOS: add support for ARM64 architecture with UEFI firmware Signed-off-by: Maurice Zhou --- .../NixOS/Root on ZFS/1-preparation.rst | 11 +++++++++++ .../NixOS/Root on ZFS/3-system-configuration.rst | 15 +++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst b/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst index 2873e0b..6811558 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst +++ b/docs/Getting Started/NixOS/Root on ZFS/1-preparation.rst @@ -6,6 +6,17 @@ Preparation .. contents:: Table of Contents :local: +This guide supports x86_64 and arm64-efi architectures. + +**Note for Tow-Boot** + +`Tow-Boot firmware `__ +enables UEFI boot on many affordable arm64 based computers. If +using Tow-Boot, NixOS and Tow-Boot must be on separate disks. +Example, Tow-Boot is installed to an SD card. Then the SD card +should not be also shared with NixOS. Install NixOS to an external +disk instead. + #. Disable Secure Boot. ZFS modules can not be loaded if Secure Boot is enabled. #. Download `NixOS Live Image `__ and boot from it. diff --git a/docs/Getting Started/NixOS/Root on ZFS/3-system-configuration.rst b/docs/Getting Started/NixOS/Root on ZFS/3-system-configuration.rst index 89bdd5a..51f49ce 100644 --- a/docs/Getting Started/NixOS/Root on ZFS/3-system-configuration.rst +++ b/docs/Getting Started/NixOS/Root on ZFS/3-system-configuration.rst @@ -39,6 +39,9 @@ System Configuration sed -i "s|\"hostId_placeholder\"|\"$(head -c4 /dev/urandom | od -A none -t x4| sed 's| ||g')\"|g" \ /mnt/etc/nixos/hosts/exampleHost/default.nix + sed -i "s|\"systemType_placeholder\"|\"$(uname -m)-linux\"|g" \ + /mnt/etc/nixos/flake.nix + #. Set root password:: rootPwd=$(mkpasswd -m SHA-512 -s) @@ -49,10 +52,6 @@ System Configuration "s|rootHash_placeholder|${rootPwd}|" \ /mnt/etc/nixos/hosts/exampleHost/default.nix -#. If using a system architecture other than amd64 (x86_64-linux), such as - ``aarch64-linux``, change architecture in - ``/mnt/etc/nixos/flake.nix``. - #. Optional: add SSH public key for root and change host name in ``/mnt/etc/nixos/hosts/exampleHost/default.nix``. @@ -66,10 +65,6 @@ System Configuration git -C /mnt/etc/nixos commit -asm 'initial installation' -#. Exit ephemeral nix shell with git:: - - exit - #. Update flake lock file to track latest system version:: nix \ @@ -83,6 +78,10 @@ System Configuration If the host name was changed, use the new host name in this command. +#. Exit ephemeral nix shell with git:: + + exit + #. Unmount filesystems:: umount -Rl /mnt