diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-01 12:54:03 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-01 12:55:56 +0200 |
commit | e8ad22be127b3d4b548c2138221b0e446ed298b2 (patch) | |
tree | 595b0a50a161a3e5602fde440c5b3e35f33e3297 /nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix | |
parent | 9f0e137338a0c8186a104b4af5c6d49d09552784 (diff) | |
download | nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar.gz nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar.bz2 nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar.lz nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar.xz nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.tar.zst nixpkgs-e8ad22be127b3d4b548c2138221b0e446ed298b2.zip |
Rename gummiboot module
Diffstat (limited to 'nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix')
-rw-r--r-- | nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix new file mode 100644 index 00000000000..a778a4f539c --- /dev/null +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -0,0 +1,62 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.boot.loader.systemd-boot; + + efi = config.boot.loader.efi; + + gummibootBuilder = pkgs.substituteAll { + src = ./systemd-boot-builder.py; + + isExecutable = true; + + inherit (pkgs) python; + + systemd = config.systemd.package; + + nix = config.nix.package.out; + + timeout = if config.boot.loader.timeout != null then config.boot.loader.timeout else ""; + + inherit (efi) efiSysMountPoint canTouchEfiVariables; + }; +in { + + imports = + [ (mkRenamedOptionModule [ "boot" "loader" "gummiboot" "enable" ] [ "boot" "loader" "systemd-boot" "enable" ]) + ]; + + options.boot.loader.systemd-boot = { + enable = mkOption { + default = false; + + type = types.bool; + + description = "Whether to enable the systemd-boot (formerly gummiboot) EFI boot manager"; + }; + }; + + config = mkIf cfg.enable { + assertions = [ + { + assertion = (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) ? efiBootStub; + + message = "This kernel does not support the EFI boot stub"; + } + ]; + + boot.loader.grub.enable = mkDefault false; + + system = { + build.installBootLoader = gummibootBuilder; + + boot.loader.id = "systemd-boot"; + + requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "EFI_STUB") + ]; + }; + }; +} |