Skip to content

Commit

Permalink
nixos/coral: init
Browse files Browse the repository at this point in the history
Provides a small wrapper to enable support for Coral USB and PCIe
devices.
  • Loading branch information
mweinelt committed Nov 22, 2024
1 parent aa0a262 commit 2b2a669
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
38 changes: 38 additions & 0 deletions nixos/modules/hardware/coral.nix
Original file line number Diff line number Diff line change
@@ -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"
'';
})
];
}
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b2a669

Please sign in to comment.