nixos/hosts/modules/usb.nix
2024-08-18 23:56:48 +02:00

22 lines
709 B
Nix

{ pkgs, config, ... }:
{
# USB Automounting
# services.gvfs.enable = true;
services.udisks2.enable = true;
# services.devmon.enable = true;
# Enable USB Guard
services.usbguard = {
enable = config.var.usbguard;
dbus.enable = true;
implicitPolicyTarget = "block";
# FIXME: set yours pref USB devices (change {id} to your trusted USB device), use `lsusb` command (from usbutils package) to get list of all connected USB devices including integrated devices like camera, bluetooth, wifi, etc. with their IDs or just disable `usbguard`
# allow id {id} # device 1...
rules = "";
};
# Enable USB-specific packages
environment.systemPackages = with pkgs; [ usbutils ];
}