boot-fit.nix (513B)
1 { 2 config, 3 pkgs, 4 lib, 5 ... 6 }: 7 let 8 inherit (lib) 9 mkIf 10 mkEnableOption 11 ; 12 inherit (pkgs.pseudofile) dir symlink; 13 cfg = config.boot.loader.fit; 14 o = config.system.outputs; 15 in 16 { 17 options.boot.loader.fit.enable = mkEnableOption "FIT in /boot"; 18 19 config = mkIf cfg.enable { 20 system.outputs.bootfiles = pkgs.runCommand "boot-fit" { } '' 21 mkdir $out 22 cd $out 23 cp ${o.uimage} fit 24 ''; 25 filesystem = dir { 26 boot = symlink config.system.outputs.bootfiles; 27 }; 28 }; 29 }