nixos/coral: init
Provides a small wrapper to enable support for Coral USB and PCIe devices.
This commit is contained in:
parent
aa0a26280d
commit
2b2a669741
@ -85,6 +85,8 @@
|
||||
|
||||
## 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.
|
||||
|
||||
- [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).
|
||||
|
38
nixos/modules/hardware/coral.nix
Normal file
38
nixos/modules/hardware/coral.nix
Normal 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"
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
@ -52,6 +52,7 @@
|
||||
./hardware/bladeRF.nix
|
||||
./hardware/brillo.nix
|
||||
./hardware/ckb-next.nix
|
||||
./hardware/coral.nix
|
||||
./hardware/corectrl.nix
|
||||
./hardware/cpu/amd-microcode.nix
|
||||
./hardware/cpu/amd-sev.nix
|
||||
|
Loading…
Reference in New Issue
Block a user