new rules

This commit is contained in:
ari committed 2024-07-27 12:21:43 -04:00
1 parent 33a27faf92
commit 85068ac330
3 files changed
+25 -5

No files matched your search

+2 -5
View File
@@ -6,10 +6,7 @@
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Special udev rule (coral tpu)
services.udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", MODE="0664", TAG+="uaccess", SYMLINK+="coraltpu"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9302", MODE="0664", TAG+="uaccess", SYMLINK+="coraltpu"
'';
# Special udev rule for google's coral tpu
homelab.udevrules.coraltpu.enable = true;
}
+22
View File
@@ -0,0 +1,22 @@
{ config, lib, ... }:
with lib;
let cfg = config.homelab.udevrules.coraltpu;
in {
options = {
homelab.udevrules.coraltpu = {
enable = mkEnableOption
"Enable Coral TPU Udev rules";
symlinkName = mkOption {
description = "The special symlink to give to the coral tpu";
type = types.str;
default = "coral1";
};
};
};
config = mkIf cfg.enable {
services.udev.extraRules = ''
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", MODE="0664", TAG+="uaccess", SYMLINK+="${cfg.symlinkName}"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9302", MODE="0664", TAG+="uaccess", SYMLINK+="${cfg.symlinkName}"
'';
};
}
+1
View File
@@ -2,5 +2,6 @@
{
imports = [
./audiobookshelf.nix
./coral-tpu-udev.nix
];
}