1 { config, lib, pkgs, ... }:
7 generationsDirBuilder = pkgs.substituteAll {
8 src = ./generations-dir-builder.sh;
11 path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
12 inherit (config.boot.loader.generationsDir) copyKernels;
20 boot.loader.generationsDir = {
26 Whether to create symlinks to the system generations under
27 `/boot`. When enabled,
28 `/boot/default/kernel`,
29 `/boot/default/initrd`, etc., are updated to
30 point to the current generation's kernel image, initial RAM
31 disk, and other bootstrap files.
33 This optional is not necessary with boot loaders such as GNU GRUB
34 for which the menu is updated to point to the latest bootstrap
35 files. However, it is needed for U-Boot on platforms where the
36 boot command line is stored in flash memory rather than in a
41 copyKernels = mkOption {
45 Whether to copy the necessary boot files into /boot, so
46 /nix/store is not needed by the boot loader.
55 config = mkIf config.boot.loader.generationsDir.enable {
57 system.build.installBootLoader = generationsDirBuilder;
58 system.boot.loader.id = "generationsDir";
59 system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.linux-kernel.target;