This repository provides an easy way to deploy NixOS to Raspberry Pi Compute Module 4s (CM4), which serve as nodes in the Turing Pi 2 cluster. It leverages Nix flakes and the raspberry-pi-nix project to simplify the deployment process.
Before deploying, ensure your system meets the following requirements:
If you are compiling the Raspberry Pi image on a system that is not aarch64
, you need to enable architecture emulation by adding the following to your NixOS configuration:
boot.binfmt.emulatedSystems = ["aarch64-linux"];
To avoid compiling the Raspberry Pi Linux kernel fork, you can use the nix-community Cachix cache. Add the following to your NixOS configuration:
nix = {
settings = {
experimental-features = ["nix-command" "flakes"];
substituters = ["https://nix-community.cachix.org"];
trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
};
};
- Clone this repository.
git clone https://github.com/your-username/turing-pi-nix.git cd turing-pi-nix
- Modify
configuration.nix
to suit your setup. - Run the deployment command.
You can choose to deploy to a single node, a range of nodes or a list of nodes according to the following formats:
nix run . <NODE_NUMBER|NODE_RANGE|NODE_LIST> <IP_ADDRESS> <USER> <PASSWORD>
- A single number:
1
- A range:
1-3
- A comma-separated list:
1,3,4
- A single number:
This project utilizes the following tools:
This project is licensed under the MIT License.
If you have suggestions or improvements, feel free to open an issue or submit a pull request!