feat: add udev, onepassword, bootloader, power features

This commit is contained in:
2026-04-12 21:28:14 +00:00
parent b8509196d5
commit 8793f97a04
4 changed files with 167 additions and 0 deletions

40
features/bootloader.nix Normal file
View File

@@ -0,0 +1,40 @@
{
nixos =
{ config, lib, inputs, ... }:
let
cfg = config.features.bootloader;
in
{
imports = [ inputs.lanzaboote.nixosModules.lanzaboote ];
options.features.bootloader = {
enable = lib.mkEnableOption "bootloader";
mode = lib.mkOption {
type = lib.types.enum [
"systemd-boot"
"lanzaboote"
];
default = "systemd-boot";
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
boot.loader.efi.canTouchEfiVariables = true;
}
(lib.mkIf (cfg.mode == "systemd-boot") {
boot.loader.systemd-boot.enable = true;
})
(lib.mkIf (cfg.mode == "lanzaboote") {
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/var/lib/sbctl";
};
})
]);
};
}