2023-07-18 17:03:01 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib)
|
|
|
|
mkEnableOption
|
|
|
|
mkIf
|
|
|
|
mkMerge;
|
|
|
|
|
2023-07-18 17:07:14 +02:00
|
|
|
cfg = config.dgn-hardware;
|
2023-07-18 17:03:01 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.dgn-hardware = {
|
|
|
|
enable = mkEnableOption "default hardware configuration." // { default = true; };
|
|
|
|
|
|
|
|
useSystemd = mkEnableOption "sytemd boot and configuration." // { default = true; };
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
{ hardware.enableRedistributableFirmware = true; }
|
|
|
|
|
|
|
|
(mkIf cfg.useSystemd {
|
|
|
|
boot.loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|