citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

default.nix (4652B)


      1 extra:
      2 { config, lib, pkgs, ... }:
      3 let
      4   kindle-opts = ["noatime" "user" "gid=100" "uid=1000" "utf8" "x-systemd.automount"];
      5 in
      6 {
      7   boot.supportedFilesystems = ["ntfs" "exfat"];
      8 
      9   services.udev.extraRules = ''
     10     # coldcard
     11     KERNEL=="hidraw*", ATTRS{idVendor}=="d13e", ATTRS{idProduct}=="cc10", GROUP="plugdev", MODE="0666", SYMLINK+="coldcard
     12 
     13     # yubikey neo
     14     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0116", MODE="0666", SYMLINK+="yubikey-neo"
     15 
     16     # yubikey4
     17     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0407", MODE="0666", SYMLINK+="yubikey4"
     18 
     19     # kindle
     20     ATTRS{idVendor}=="1949", ATTRS{idProduct}=="0004", SYMLINK+="kindle"
     21     ATTRS{idVendor}=="1949", ATTRS{idProduct}=="0003", SYMLINK+="kindledx"
     22 
     23     # HTC Vive HID Sensor naming and permissioning
     24     # vive hmd
     25     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", TAG+="uaccess"
     26 
     27     # vive controller
     28     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2101", TAG+="uaccess"
     29 
     30     # vive lighthouse
     31     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2000", TAG+="uaccess"
     32     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1043", TAG+="uaccess"
     33     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2050", TAG+="uaccess"
     34     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2011", TAG+="uaccess"
     35     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="2012", TAG+="uaccess"
     36 
     37     # vive audio
     38     KERNEL=="hidraw*", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="0012", MODE="0666"
     39 
     40     SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="2c87", TAG+="uaccess"
     41 
     42     # HTC Camera USB Node
     43     SUBSYSTEM=="usb", ATTRS{idVendor}=="114d", ATTRS{idProduct}=="8328", TAG+="uaccess"
     44 
     45     # HTC Mass Storage Node
     46     SUBSYSTEM=="usb", ATTRS{idVendor}=="114d", ATTRS{idProduct}=="8200", TAG+="uaccess"
     47 
     48     # ds4
     49     KERNEL=="uinput", MODE="0666"
     50     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
     51     KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:054C:05C4.*", MODE="0666"
     52 
     53     # Nintendo Switch Pro Controller over USB hidraw
     54     KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0666"
     55 
     56     # Nintendo Switch Pro Controller over bluetooth hidraw
     57     KERNEL=="hidraw*", KERNELS=="*057E:2009*", MODE="0666"
     58 
     59     # rtl-sdr
     60     SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE="0666", SYMLINK+="rtl_sdr"
     61     SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE="0666", SYMLINK+="rtl_sdr_dvb"
     62 
     63     # arduino
     64     SUBSYSTEM=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", MODE="0666", SYMLINK+="arduino"
     65   '';
     66 
     67   services.xserver.config = ''
     68     Section "InputClass"
     69       Identifier "Logitech M705"
     70       MatchIsPointer "yes"
     71       Option "AccelerationProfile" "-1"
     72       Option "ConstantDeceleration" "5"
     73       Option "AccelerationScheme" "none"
     74       Option "AccelSpeed" "-1"
     75     EndSection
     76 
     77     Section "InputClass"
     78       Identifier "Lenovo ThinkPad Compact USB Keyboard with TrackPoint"
     79       MatchProduct "Lenovo ThinkPad Compact USB Keyboard with TrackPoint"
     80       Driver "libinput"
     81       Option "AccelSpeed" "0.1"
     82     EndSection
     83 
     84     Section "InputClass"
     85       Identifier "Razer Razer DeathAdder 2013"
     86       MatchIsPointer "yes"
     87       Option "AccelerationProfile" "-1"
     88       Option "ConstantDeceleration" "5"
     89       Option "AccelerationScheme" "none"
     90       Option "AccelSpeed" "-1"
     91     EndSection
     92   '';
     93 
     94   #services.printing.drivers = [ pkgs.cups-brother-hll2370dw ];
     95 
     96   boot.blacklistedKernelModules = ["dvb_usb_rtl28xxu"];
     97   fileSystems."/media/kindle" =
     98     { device = "/dev/kindle";
     99       fsType = "vfat";
    100       options = kindle-opts;
    101     };
    102 
    103   fileSystems."/media/kindledx" =
    104     { device = "/dev/kindledx";
    105       fsType = "vfat";
    106       options = kindle-opts;
    107     };
    108 
    109 
    110   hardware.pulseaudio.enable = false;
    111   hardware.pulseaudio.support32Bit = true;
    112   hardware.pulseaudio.package = if extra.is-minimal then pkgs.pulseaudio else pkgs.pulseaudioFull;
    113   hardware.pulseaudio.daemon.config = {
    114     default-sample-rate = "48000";
    115   };
    116 
    117   hardware = {
    118     bluetooth.enable = true;
    119     #opengl.driSupport32Bit = true;
    120 
    121     graphics = {
    122         enable = true;
    123         enable32Bit = true;
    124     };
    125 
    126     #amdgpu.amdvlk = {
    127     #    enable = true;
    128     #    support32Bit.enable = true;
    129     #};
    130   };
    131 }