From e0a0232394634bade08d2e761b64e0e38bdcde5c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 8 Aug 2022 12:35:40 -0600 Subject: [PATCH] [NixOS] stevie-nixos tweaks --- nixos/machines/stevie-nixos.nix | 41 +++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/nixos/machines/stevie-nixos.nix b/nixos/machines/stevie-nixos.nix index 1a63275f..e2c12683 100644 --- a/nixos/machines/stevie-nixos.nix +++ b/nixos/machines/stevie-nixos.nix @@ -4,17 +4,53 @@ imports = [ ../full.nix ../base.nix - inputs.nixos-hardware.nixosModules.dell-xps-17-9700-nvidia ]; hardware.enableRedistributableFirmware = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = with config.boot.kernelPackages; [ ]; + services.xserver = { + videoDrivers = [ "modesetting ""nvidia" ]; + }; + + services.thermald.enable = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + boot.kernelPatches = [{ + name = "enable-soundwire-drivers"; + patch = null; + extraConfig = '' + SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES y + SND_SOC_INTEL_SOUNDWIRE_SOF_MACH m + SND_SOC_RT1308 m + ''; + ignoreConfigErrors = true; + }]; + + hardware.nvidia.prime = { + sync.enable = true; + + # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA + nvidiaBusId = "PCI:1:0:0"; + + # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA + intelBusId = "PCI:0:2:0"; + }; + + services.xserver.screenSection = '' + Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}" + Option "AllowIndirectGLXProtocol" "off" + Option "TripleBuffer" "on" + ''; + boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -41,6 +77,7 @@ powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.video.hidpi.enable = true; + services.xserver.dpi = 180; system.stateVersion = "21.05"; }