Loading nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +37 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ let $out ''; edk2ShellEspPath = "efi/edk2-uefi-shell/shell.efi"; systemdBootBuilder = pkgs.substituteAll rec { name = "systemd-boot"; Loading Loading @@ -72,6 +74,8 @@ let netbootxyz = optionalString cfg.netbootxyz.enable pkgs.netbootxyz-efi; edk2-uefi-shell = optionalString cfg.edk2-uefi-shell.enable pkgs.edk2-uefi-shell; checkMountpoints = pkgs.writeShellScript "check-mountpoints" '' fail() { echo "$1 = '$2' is not a mounted partition. Is the path configured correctly?" >&2 Loading Loading @@ -343,6 +347,29 @@ in }; }; edk2-uefi-shell = { enable = mkOption { type = types.bool; default = false; description = '' Make the EDK2 UEFI Shell available from the systemd-boot menu. It can be used to manually boot other operating systems or for debugging. ''; }; sortKey = mkOption { type = types.str; default = "o_edk2-uefi-shell"; description = '' `systemd-boot` orders the menu entries by their sort keys, so if you want something to appear after all the NixOS entries, it should start with {file}`o` or onwards. See also {option}`boot.loader.systemd-boot.sortKey`.. ''; }; }; extraEntries = mkOption { type = types.attrsOf types.lines; default = { }; Loading Loading @@ -476,6 +503,9 @@ in (mkIf cfg.netbootxyz.enable { "efi/netbootxyz/netboot.xyz.efi" = "${pkgs.netbootxyz-efi}"; }) (mkIf cfg.edk2-uefi-shell.enable { ${edk2ShellEspPath} = "${pkgs.edk2-uefi-shell}/shell.efi"; }) ]; boot.loader.systemd-boot.extraEntries = mkMerge [ Loading @@ -493,6 +523,13 @@ in sort-key ${cfg.netbootxyz.sortKey} ''; }) (mkIf cfg.edk2-uefi-shell.enable { "edk2-uefi-shell.conf" = '' title EDK2 UEFI Shell efi /${edk2ShellEspPath} sort-key ${cfg.edk2-uefi-shell.sortKey} ''; }) ]; boot.bootspec.extensions."org.nixos.systemd-boot" = { Loading nixos/tests/systemd-boot.nix +15 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,21 @@ in ''; }; edk2-uefi-shell = makeTest { name = "systemd-boot-edk2-uefi-shell"; meta.maintainers = with pkgs.lib.maintainers; [ iFreilicht ]; nodes.machine = { ... }: { imports = [ common ]; boot.loader.systemd-boot.edk2-uefi-shell.enable = true; }; testScript = '' machine.succeed("test -e /boot/loader/entries/edk2-uefi-shell.conf") machine.succeed("test -e /boot/efi/edk2-uefi-shell/shell.efi") ''; }; memtestSortKey = makeTest { name = "systemd-boot-memtest-sortkey"; meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ]; Loading Loading
nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +37 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ let $out ''; edk2ShellEspPath = "efi/edk2-uefi-shell/shell.efi"; systemdBootBuilder = pkgs.substituteAll rec { name = "systemd-boot"; Loading Loading @@ -72,6 +74,8 @@ let netbootxyz = optionalString cfg.netbootxyz.enable pkgs.netbootxyz-efi; edk2-uefi-shell = optionalString cfg.edk2-uefi-shell.enable pkgs.edk2-uefi-shell; checkMountpoints = pkgs.writeShellScript "check-mountpoints" '' fail() { echo "$1 = '$2' is not a mounted partition. Is the path configured correctly?" >&2 Loading Loading @@ -343,6 +347,29 @@ in }; }; edk2-uefi-shell = { enable = mkOption { type = types.bool; default = false; description = '' Make the EDK2 UEFI Shell available from the systemd-boot menu. It can be used to manually boot other operating systems or for debugging. ''; }; sortKey = mkOption { type = types.str; default = "o_edk2-uefi-shell"; description = '' `systemd-boot` orders the menu entries by their sort keys, so if you want something to appear after all the NixOS entries, it should start with {file}`o` or onwards. See also {option}`boot.loader.systemd-boot.sortKey`.. ''; }; }; extraEntries = mkOption { type = types.attrsOf types.lines; default = { }; Loading Loading @@ -476,6 +503,9 @@ in (mkIf cfg.netbootxyz.enable { "efi/netbootxyz/netboot.xyz.efi" = "${pkgs.netbootxyz-efi}"; }) (mkIf cfg.edk2-uefi-shell.enable { ${edk2ShellEspPath} = "${pkgs.edk2-uefi-shell}/shell.efi"; }) ]; boot.loader.systemd-boot.extraEntries = mkMerge [ Loading @@ -493,6 +523,13 @@ in sort-key ${cfg.netbootxyz.sortKey} ''; }) (mkIf cfg.edk2-uefi-shell.enable { "edk2-uefi-shell.conf" = '' title EDK2 UEFI Shell efi /${edk2ShellEspPath} sort-key ${cfg.edk2-uefi-shell.sortKey} ''; }) ]; boot.bootspec.extensions."org.nixos.systemd-boot" = { Loading
nixos/tests/systemd-boot.nix +15 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,21 @@ in ''; }; edk2-uefi-shell = makeTest { name = "systemd-boot-edk2-uefi-shell"; meta.maintainers = with pkgs.lib.maintainers; [ iFreilicht ]; nodes.machine = { ... }: { imports = [ common ]; boot.loader.systemd-boot.edk2-uefi-shell.enable = true; }; testScript = '' machine.succeed("test -e /boot/loader/entries/edk2-uefi-shell.conf") machine.succeed("test -e /boot/efi/edk2-uefi-shell/shell.efi") ''; }; memtestSortKey = makeTest { name = "systemd-boot-memtest-sortkey"; meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ]; Loading