-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsystemd-boot.nix
28 lines (26 loc) · 981 Bytes
/
systemd-boot.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ config, lib, pkgs, ... }:
let cfg = config.cookie.systemd-boot;
in with lib; {
options.cookie.systemd-boot = {
enable = mkEnableOption "systemd-boot bootloader";
memtest = mkEnableOption "memtest86" // {
default = lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.memtest86plus;
};
};
config = mkIf cfg.enable {
boot.loader.systemd-boot = {
enable = true;
editor = false;
configurationLimit = 16;
# From https://matrix.to/#/!sgkZKRutwatDMkYBHU:nixos.org/$iKnJUt1L_7E5bq7hStDPwv6_2HTBvNjwfcWxlKlF-k8?via=nixos.org&via=matrix.org&via=nixos.dev
# There's a dedicated NixOS option but it uses the propietary memtest86, not memtest86+
# TODO: Fix?
extraFiles."efi/memtest86plus/memtest.efi" =
mkIf cfg.memtest "${pkgs.memtest86plus}/memtest.efi";
extraEntries."memtest86plus.conf" = mkIf cfg.memtest ''
title MemTest86+
efi /efi/memtest86plus/memtest.efi
'';
};
};
}