From 9c1298ce8b6c72aa766ee5b25090b470058b1951 Mon Sep 17 00:00:00 2001 From: Nate Anderson Date: Mon, 9 Jun 2025 10:20:23 -0600 Subject: [PATCH] Added i2c support for ddcutil and fix firefox extension deprecation --- nate-work/modules/apps/firefox/firefox.nix | 2 +- nate-work/modules/hypr/hyprland.nix | 72 +++++++++++++--------- nate-work/modules/sway/sway_conf.nix | 4 +- nate-work/modules/user/main_user.nix | 1 + nate-work/nixos/hardware-configuration.nix | 2 +- 5 files changed, 48 insertions(+), 33 deletions(-) diff --git a/nate-work/modules/apps/firefox/firefox.nix b/nate-work/modules/apps/firefox/firefox.nix index bc6f854..4257b1a 100644 --- a/nate-work/modules/apps/firefox/firefox.nix +++ b/nate-work/modules/apps/firefox/firefox.nix @@ -20,7 +20,7 @@ in id = 0; name = "default"; isDefault = true; - extensions = with pkgs; [ + extensions.packages = with pkgs; [ nur.repos.rycee.firefox-addons.darkreader nur.repos.rycee.firefox-addons.keepassxc-browser nur.repos.crazazy.firefox-addons.ublock-origin diff --git a/nate-work/modules/hypr/hyprland.nix b/nate-work/modules/hypr/hyprland.nix index 127d070..4a59455 100644 --- a/nate-work/modules/hypr/hyprland.nix +++ b/nate-work/modules/hypr/hyprland.nix @@ -222,6 +222,15 @@ in # Use latest kernel # 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" ]; hardware = { graphics = { @@ -268,38 +277,41 @@ in }; }; # Create special on the go boot entry - specialisation = { - on-the-go.configuration = { - system.nixos.tags = [ "on-the-go" ]; + # + ## Commenting out for now as it doesn't really work with the laptop well... + # + # specialisation = { + # on-the-go.configuration = { + # system.nixos.tags = [ "on-the-go" ]; - boot.extraModprobeConfig = '' - blacklist nouveau - options nouveau modeset=0 - ''; + # boot.extraModprobeConfig = '' + # blacklist nouveau + # options nouveau modeset=0 + # ''; - services.udev.extraRules = '' - # 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" - # 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" - # Remove NVIDIA Audio devices, if present - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" - # 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" - ''; - hardware.nvidia = { - prime.offload.enable = lib.mkForce false; - prime.offload.enableOffloadCmd = lib.mkForce false; - powerManagement.finegrained = lib.mkForce false; - prime.sync.enable = lib.mkForce false; - }; - 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"` - boot.kernelParams = [ "i915.force_probe=a7a0" "acpi_backlight=native" ]; - # Default drivers - services.xserver.videoDrivers = [ "modesetting" "fbdev" ]; - }; - }; + # services.udev.extraRules = '' + # # 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" + # # 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" + # # Remove NVIDIA Audio devices, if present + # ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" + # # 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" + # ''; + # hardware.nvidia = { + # prime.offload.enable = lib.mkForce false; + # prime.offload.enableOffloadCmd = lib.mkForce false; + # powerManagement.finegrained = lib.mkForce false; + # prime.sync.enable = lib.mkForce false; + # }; + # 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"` + # boot.kernelParams = [ "i915.force_probe=a7a0" "acpi_backlight=native" ]; + # # Default drivers + # services.xserver.videoDrivers = [ "modesetting" "fbdev" ]; + # }; + # }; nixpkgs.config.allowUnfree = true; }; } diff --git a/nate-work/modules/sway/sway_conf.nix b/nate-work/modules/sway/sway_conf.nix index ce08c35..ec788fe 100644 --- a/nate-work/modules/sway/sway_conf.nix +++ b/nate-work/modules/sway/sway_conf.nix @@ -138,11 +138,13 @@ enable = true; openFirewall = true; }; - # For betaflight configurator 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" ''; # For yubioath desktop services.pcscd.enable = true; diff --git a/nate-work/modules/user/main_user.nix b/nate-work/modules/user/main_user.nix index ac57f03..5b01374 100644 --- a/nate-work/modules/user/main_user.nix +++ b/nate-work/modules/user/main_user.nix @@ -43,6 +43,7 @@ in cfg.userName "dialout" "docker" + "i2c" "lp" "networkmanager" "scanner" diff --git a/nate-work/nixos/hardware-configuration.nix b/nate-work/nixos/hardware-configuration.nix index 669d98f..19a52ad 100644 --- a/nate-work/nixos/hardware-configuration.nix +++ b/nate-work/nixos/hardware-configuration.nix @@ -11,7 +11,7 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.kernelModules = [ ]; boot.kernelParams = [ "acpi_backlight=native" "snd_seq_midi.output_buffer_size=131072" ]; - boot.kernelModules = [ "kvm-intel" ]; + boot.kernelModules = [ "kvm-intel" "i2c-dev" ]; boot.extraModulePackages = [ ]; fileSystems."/" =