I got a small server from HP (Proliant Gen8). The installation preconditions are a bit special:
It has 5 SATA ports (4 for the drive bays and one for a optical drive) but the BIOS (no EFI) can’t boot from the optical drive for some reason. However, there’s an internal SD-Card reader which can be used for boot. I don’t want to install the whole OS on the SD-Card for obvious reasons but just writing the bootloader should be fine. I don’t want to write the bootloader on any of the other SATA disks because they should be dedicated to storage.
Considering these conditions I came up with following configuration for the NixOS installation (only the boot part):
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.devices = [
"/dev/disk/by-id/usb-HP_iLO_Internal_SD-CARD_000002660A01-0:0"
];
boot.initrd = {
luks.devices = [
{
name = "root";
device = "/dev/disk/by-uuid/94796159-5d55-417c-bdda-e9d482e19c71";
preLVM = true;
allowDiscards = true;
}
];
};
fileSystems."/".options = [ "noatime" "nodiratime" ];
The installation works fine but after a reboot, the BIOS can’t detect any bootable system. For the whole installation I followed this guide but without the EFI part: Installation of NixOS with encrypted root · GitHub