nixos/facetimehd: add option hardware.facetimehd.withCalibration

The new option (disabled by default) pulls in the experimental sensor
calibration files for the Facetime HD camera. These will also be pulled
in by hardware.enableAllFirmware.
This commit is contained in:
Alexander Shpilkin 2022-03-15 03:42:49 +03:00
parent 8d0b575eb4
commit 0d233ebed0
No known key found for this signature in database
GPG key ID: 55F6F5B75637BD38
2 changed files with 18 additions and 2 deletions

View file

@ -84,7 +84,10 @@ in {
b43Firmware_6_30_163_46
b43FirmwareCutter
xow_dongle-firmware
] ++ optional pkgs.stdenv.hostPlatform.isx86 facetimehd-firmware;
] ++ optionals pkgs.stdenv.hostPlatform.isx86 [
facetimehd-calibration
facetimehd-firmware
];
})
(mkIf cfg.wirelessRegulatoryDatabase {
hardware.firmware = [ pkgs.wireless-regdb ];

View file

@ -14,6 +14,18 @@ in
options.hardware.facetimehd.enable = mkEnableOption "facetimehd kernel module";
options.hardware.facetimehd.withCalibration = mkOption {
default = false;
example = true;
type = types.bool;
description = ''
Whether to include sensor calibration files for facetimehd.
This makes colors look much better but is experimental, see
<link xlink:href="https://github.com/patjak/facetimehd/wiki/Extracting-the-sensor-calibration-files"/>
for details.
'';
};
config = mkIf cfg.enable {
assertions = singleton {
@ -27,7 +39,8 @@ in
boot.extraModulePackages = [ kernelPackages.facetimehd ];
hardware.firmware = [ pkgs.facetimehd-firmware ];
hardware.firmware = [ pkgs.facetimehd-firmware ]
++ optional cfg.withCalibration pkgs.facetimehd-calibration;
# unload module during suspend/hibernate as it crashes the whole system
powerManagement.powerDownCommands = ''