nixos/coral: init

Provides a small wrapper to enable support for Coral USB and PCIe
devices.
This commit is contained in:
Martin Weinelt 2024-11-21 14:56:52 +01:00
parent aa0a26280d
commit 2b2a669741
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
3 changed files with 41 additions and 0 deletions

View File

@ -85,6 +85,8 @@
## New Modules {#sec-release-24.11-new-modules} ## New Modules {#sec-release-24.11-new-modules}
- [Coral](https://coral.ai/), hardware support for Coral.ai Edge TPU devices. Available as [hardware.coral.usb.enable](#opt-hardware.coral.usb.enable) and [hardware.coral.pcie.enable](#opt-hardware.coral.pcie.enable).
- [Cyrus IMAP](https://github.com/cyrusimap/cyrus-imapd), an email, contacts and calendar server. Available as [services.cyrus-imap](#opt-services.cyrus-imap.enable) service. - [Cyrus IMAP](https://github.com/cyrusimap/cyrus-imapd), an email, contacts and calendar server. Available as [services.cyrus-imap](#opt-services.cyrus-imap.enable) service.
- [TaskChampion Sync-Server](https://github.com/GothenburgBitFactory/taskchampion-sync-server), a [Taskwarrior 3](https://taskwarrior.org/docs/upgrade-3/) sync server. Available as [services.taskchampion-sync-server](#opt-services.taskchampion-sync-server.enable). - [TaskChampion Sync-Server](https://github.com/GothenburgBitFactory/taskchampion-sync-server), a [Taskwarrior 3](https://taskwarrior.org/docs/upgrade-3/) sync server. Available as [services.taskchampion-sync-server](#opt-services.taskchampion-sync-server.enable).

View File

@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkEnableOption
mkIf
mkMerge
;
cfg = config.hardware.coral;
in
{
options.hardware.coral = {
usb.enable = mkEnableOption "Coral USB support";
pcie.enable = mkEnableOption "Coral PCIe support";
};
config = mkMerge [
(mkIf (cfg.usb.enable || cfg.pcie.enable) {
users.groups.coral = { };
})
(mkIf cfg.usb.enable {
services.udev.packages = with pkgs; [ libedgetpu ];
})
(mkIf cfg.pcie.enable {
boot.extraModulePackages = with config.boot.kernelPackages; [ gasket ];
services.udev.extraRules = ''
SUBSYSTEM=="apex",MODE="0660",GROUP="coral"
'';
})
];
}

View File

@ -52,6 +52,7 @@
./hardware/bladeRF.nix ./hardware/bladeRF.nix
./hardware/brillo.nix ./hardware/brillo.nix
./hardware/ckb-next.nix ./hardware/ckb-next.nix
./hardware/coral.nix
./hardware/corectrl.nix ./hardware/corectrl.nix
./hardware/cpu/amd-microcode.nix ./hardware/cpu/amd-microcode.nix
./hardware/cpu/amd-sev.nix ./hardware/cpu/amd-sev.nix