Wikipedia: In architecture, a socle is a short plinth used to support a pedestal, sculpture, or column.
A collection of packages and modules to support NixOS on single-board computers based on the RK3588(S) SoC. Currently, the following boards are supported:
- Orange Pi 5
- Orange Pi 5 Plus
- Linux Kernel 6.1
- OpenCL 3.0 with libmali
- Options to enable device tree overlays
Socle provides a template you can use as a base for your new NixOS installation.
The easiest way to build an image is to use the provided flake template. The template contains NixOS configurations for Orange Pi 5 and Orange Pi 5 Plus.
-
Clone the template:
nix flake new --template github:dvdjv/socle nixosThis will create a directory named
nixoswith the system configurations in it. -
(Optional) Edit the configuration:
Open the file
nixos/configuration.nixin a text editor. To change the default user credentials, locate the following lines:users.users.nixos = { isNormalUser = true; password = "nixos"; extraGroups = [ "wheel" ]; };Adjust the username, password, and groups as you see fit. To change the timezone, locate the following lines:
# You can set your timezone here # time.timeZone = "Europe/Dublin";Uncomment the timezone option and insert your timezone.
You can tune other options as well. Consult the NixOS manual for the list of possible options. Board-specific options are set in the files
orangepi5.nixandorangepi5plus.nix. Notice, that the default network name differs between the boards. -
Build the image
On a
aarch64-linuxmachine:nix build .#nixosConfigurations.orangepi5.config.system.build.sdImageto build an Orange Pi 5 image; or:
nix build .#nixosConfigurations.orangepi5plus.config.system.build.sdImageto build an Orange Pi 5 Plus image.
On a
x86_64-linuxmachine:Cross compilation does not use the binary pachage cache and is prone to errors. It is recommended to use a
aarch64-linuxmachine instead.Locate the following lines in
configuration.nix# to build on aarch64 machine hostPlatform = { system = "aarch64-linux"; }; # to build on x86_64 machine # hostPlatform = { system = "aarch64-linux"; }; # buildPlatform = { system = "x86_64-linux"; };and change it to
# to build on aarch64 machine # hostPlatform = { system = "aarch64-linux"; }; # to build on x86_64 machine hostPlatform = { system = "aarch64-linux"; }; buildPlatform = { system = "x86_64-linux"; };Build the image as described above.
-
Flash the image:
zstdcat result/sd-image/nixos-sd-image-23.11pre-git-aarch64-linux.img.zst | dd of=/dev/sdX bs=1MReplace
/dev/sdXwith the device node corresponding to your SD card.
Device tree overlays can be enabled using the board.hardware.enabled option. Examples are provided in the flake templates. For a complete list of hardware options, refer to the board-specific modules in the source code.