nixos/hardware.facetimehd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-24 22:05:31 +02:00
parent 4fa8726a44
commit bbe907f0a9

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.hardware.facetimehd;
@ -12,12 +9,12 @@ in
{
options.hardware.facetimehd.enable = mkEnableOption "the facetimehd kernel module";
options.hardware.facetimehd.enable = lib.mkEnableOption "the facetimehd kernel module";
options.hardware.facetimehd.withCalibration = mkOption {
options.hardware.facetimehd.withCalibration = lib.mkOption {
default = false;
example = true;
type = types.bool;
type = lib.types.bool;
description = ''
Whether to include sensor calibration files for facetimehd.
This makes colors look much better but is experimental, see
@ -26,7 +23,7 @@ in
'';
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
boot.kernelModules = [ "facetimehd" ];
@ -35,7 +32,7 @@ in
boot.extraModulePackages = [ kernelPackages.facetimehd ];
hardware.firmware = [ pkgs.facetimehd-firmware ]
++ optional cfg.withCalibration pkgs.facetimehd-calibration;
++ lib.optional cfg.withCalibration pkgs.facetimehd-calibration;
# unload module during suspend/hibernate as it crashes the whole system
powerManagement.powerDownCommands = ''