Added i2c support for ddcutil and fix firefox extension deprecation

This commit is contained in:
Nate Anderson 2025-06-09 10:20:23 -06:00
parent 4a6e36055c
commit 9c1298ce8b
5 changed files with 48 additions and 33 deletions

View File

@ -20,7 +20,7 @@ in
id = 0; id = 0;
name = "default"; name = "default";
isDefault = true; isDefault = true;
extensions = with pkgs; [ extensions.packages = with pkgs; [
nur.repos.rycee.firefox-addons.darkreader nur.repos.rycee.firefox-addons.darkreader
nur.repos.rycee.firefox-addons.keepassxc-browser nur.repos.rycee.firefox-addons.keepassxc-browser
nur.repos.crazazy.firefox-addons.ublock-origin nur.repos.crazazy.firefox-addons.ublock-origin

View File

@ -222,6 +222,15 @@ in
# Use latest kernel # Use latest kernel
# boot.kernelPackages = unstable.linuxPackages_latest; # boot.kernelPackages = unstable.linuxPackages_latest;
services.udev.extraRules = ''
# For betaflight configurator
# DFU (Internal bootloader for STM32 and AT32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
# For ddcutil monitor controls
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
'';
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
hardware = { hardware = {
graphics = { graphics = {
@ -268,38 +277,41 @@ in
}; };
}; };
# Create special on the go boot entry # Create special on the go boot entry
specialisation = { #
on-the-go.configuration = { ## Commenting out for now as it doesn't really work with the laptop well...
system.nixos.tags = [ "on-the-go" ]; #
# specialisation = {
# on-the-go.configuration = {
# system.nixos.tags = [ "on-the-go" ];
boot.extraModprobeConfig = '' # boot.extraModprobeConfig = ''
blacklist nouveau # blacklist nouveau
options nouveau modeset=0 # options nouveau modeset=0
''; # '';
services.udev.extraRules = '' # services.udev.extraRules = ''
# Remove NVIDIA USB xHCI Host Controller devices, if present # # Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present # # Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1" # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present # # Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices # # Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
''; # '';
hardware.nvidia = { # hardware.nvidia = {
prime.offload.enable = lib.mkForce false; # prime.offload.enable = lib.mkForce false;
prime.offload.enableOffloadCmd = lib.mkForce false; # prime.offload.enableOffloadCmd = lib.mkForce false;
powerManagement.finegrained = lib.mkForce false; # powerManagement.finegrained = lib.mkForce false;
prime.sync.enable = lib.mkForce false; # prime.sync.enable = lib.mkForce false;
}; # };
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; # boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
# Hint to kernel for integrated graphics, ID from command `$ nix-shell -p pciutils --run "lspci -nn | grep VGA"` # # Hint to kernel for integrated graphics, ID from command `$ nix-shell -p pciutils --run "lspci -nn | grep VGA"`
boot.kernelParams = [ "i915.force_probe=a7a0" "acpi_backlight=native" ]; # boot.kernelParams = [ "i915.force_probe=a7a0" "acpi_backlight=native" ];
# Default drivers # # Default drivers
services.xserver.videoDrivers = [ "modesetting" "fbdev" ]; # services.xserver.videoDrivers = [ "modesetting" "fbdev" ];
}; # };
}; # };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
}; };
} }

View File

@ -138,11 +138,13 @@
enable = true; enable = true;
openFirewall = true; openFirewall = true;
}; };
# For betaflight configurator
services.udev.extraRules = '' services.udev.extraRules = ''
# For betaflight configurator
# DFU (Internal bootloader for STM32 and AT32 MCUs) # DFU (Internal bootloader for STM32 and AT32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout" SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout" SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
# For ddcutil monitor controls
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
''; '';
# For yubioath desktop # For yubioath desktop
services.pcscd.enable = true; services.pcscd.enable = true;

View File

@ -43,6 +43,7 @@ in
cfg.userName cfg.userName
"dialout" "dialout"
"docker" "docker"
"i2c"
"lp" "lp"
"networkmanager" "networkmanager"
"scanner" "scanner"

View File

@ -11,7 +11,7 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelParams = [ "acpi_backlight=native" "snd_seq_midi.output_buffer_size=131072" ]; boot.kernelParams = [ "acpi_backlight=native" "snd_seq_midi.output_buffer_size=131072" ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" "i2c-dev" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =