nixos-rebuild boot fails on my machine while trying to run grub:
# nixos-rebuild boot
building Nix...
building the system configuration...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/disk/by-id/ata-SAMSUNG_MMCQE28G8MUP-0VA_SE936B7450...
Installing for i386-pc platform.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b883c0] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b8af20] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b8af20] dtree
Internal error: Unreleased memory pool(s) found.
You have a memory leak (not released memory pool):
[0x1b8af20] dtree
Internal error: Unreleased memory pool(s) found.
/nix/store/53xshnldp06n3cqfjg586lzia9hcak2f-grub-2.x-2015-11-16/sbin/grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=y' in file `/nix/store/53xshnldp06n3cqfjg586lzia9hcak2f-grub-2.x-2015-11-16/etc/default/grub'.
/nix/store/zldbbngl0f8g5iv4rslygxwp0dbg1624-install-grub.pl: installation of GRUB on /dev/disk/by-id/ata-SAMSUNG_MMCQE28G8MUP-0VA_SE936B7450 failed
warning: error(s) occurred while switching to the new configuration
I'm using master at 8a0f2e7025d1682f793f67f9364564851448479e with LUKS encryption enabled for the root disk.
This error usually occurs when the device that grub installs to isn't mounted. Please check if /boot is mounted. If it is not it might got unmounted due https://github.com/NixOS/nixpkgs/issues/11480. I had this same issue.
Duplicate of https://github.com/NixOS/nixpkgs/issues/11480. Run mount /boot to remedy the issue to the extend that nixos-rebuild boot can succeed again.
Most helpful comment
This error usually occurs when the device that grub installs to isn't mounted. Please check if
/bootis mounted. If it is not it might got unmounted due https://github.com/NixOS/nixpkgs/issues/11480. I had this same issue.