feat(loader): adding support for extlinux
This commit is contained in:
@@ -8,6 +8,9 @@
|
|||||||
};
|
};
|
||||||
loader = {
|
loader = {
|
||||||
default = {
|
default = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
extlinux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ in
|
|||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
enable = mkEnableOption "Enable Lanzaboote boot loader configuration.";
|
enable = mkEnableOption "Enable Lanzaboote boot loader configuration.";
|
||||||
};
|
};
|
||||||
|
extlinux = {
|
||||||
|
enable = mkEnableOption "Enable extlinux boot loader configuration.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -34,14 +37,18 @@ in
|
|||||||
{
|
{
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = !(cfg.default.enable && cfg.lanzaboote.enable);
|
assertion =
|
||||||
message = "Only one of nixos.boot.loader.default.enable and nixos.boot.loader.lanzaboote.enable can be set to true.";
|
(lib.count (x: x) [
|
||||||
|
cfg.default.enable
|
||||||
|
cfg.lanzaboote.enable
|
||||||
|
cfg.extlinux.enable
|
||||||
|
]) <= 1;
|
||||||
|
message = "Only one of nixos.boot.loader.{default,lanzaboote,extlinux}.enable can be set to true.";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.default.enable {
|
(mkIf cfg.default.enable {
|
||||||
# Default boot loader configuration
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
systemd-boot.graceful = true;
|
systemd-boot.graceful = true;
|
||||||
@@ -49,18 +56,18 @@ in
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extlinux.enable {
|
||||||
|
boot.loader.generic-extlinux-compatible.enable = true;
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf cfg.lanzaboote.enable {
|
(mkIf cfg.lanzaboote.enable {
|
||||||
# Lanzaboote boot loader configuration
|
|
||||||
boot = {
|
boot = {
|
||||||
lanzaboote = {
|
lanzaboote = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pkiBundle = "/var/lib/sbctl";
|
pkiBundle = "/var/lib/sbctl";
|
||||||
};
|
};
|
||||||
|
|
||||||
# We let Lanzaboote install systemd-boot
|
|
||||||
loader.systemd-boot.enable = mkForce false;
|
loader.systemd-boot.enable = mkForce false;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.sbctl ];
|
environment.systemPackages = [ pkgs.sbctl ];
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user