Install NixOS with Submarine
Note: While ARM images could technically be built aswell, they are not considered ready and therefore are not supported.
Prepare an image
-
Either dowmload a
raw-x64cros
image from CI (opens in a new tab) or follow the build instructions (opens in a new tab) -
Write the image to an external media using
dd
. -
Reminder: to boot Submarine from external media, you first need to run the following commands as root.
sudo enable_dev_usb_boot
- Reboot, and on the Developer Mode screen, press Ctrl+U to boot from external media.
Partitioning
-
After booting the image, establish network connection with NetworkManager (
nmtui
ornmcli
). -
When partitioning the drive, the first partition should be a 16MB partition (64MB on aarch64) for Submarine. You do not need to create a EFI system partition (ESP) as Submarine does not use UEFI.
-
Set the necessary flags for the Submarine partition with
cgpt add -i <partition number> -t kernel -P 15 -T 1 -S 1 /dev/sdX
, substituting<partition number>
for the number of the Submarine partition and/dev/sdX
for the block device of your internal drive. -
Get Submarine by running the following command.
nix build github:ninelore/flake#submarine
- Write the Submarine
.kpart
found inresult/share/submarine/
to the Submarine partition created earlier usingdd
.
Installing
Proceed to install NixOS like you would from the official minimal ISO. Here is a quick tl;dr:
-
Mount your filesystem to
/mnt
, do not mount the Submarine partition. -
Run
nixos-generate-config --root /mnt
to generate a basic NixOS configuration in/mnt/etc/nixos/
. -
Configure your system by editing
/mnt/etc/nixos/configuration.nix
or bring your existing configuration. -
Once your configuration is ready, run
nixos-install
.
Postinstall
After you've finished installing, reboot and press Ctrl+D to boot from internal disk. If you did everything right, you should be looking at the Submarine boot menu. Select the number that corresponds to your new NixOS Generation to boot into NixOS.
For audio fixes for running Linux on Chromebooks, take a look at the NixOS Modules provided in ninelore's flake (opens in a new tab).
Note
Fyra Labs is not affiliated with the developers of NixOS, this guide is unofficial.