diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index 253bf149..3c931e31 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -14,16 +14,6 @@ services.xserver = { # Prevent system sleep after reboot to login screen. displayManager.gdm.autoSuspend = false; - # Add AMDGPU driver. - videoDrivers = [ "amdgpu" ]; - }; - - hardware.opengl = { - # Add ROCM annd AMD Vulkan driver. - extraPackages = with pkgs; [ rocmPackages.clr.icd amdvlk ]; - # Add support for 32bit apps. - driSupport32Bit = true; - extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; }; systemConfig = { diff --git a/hosts/mauville/hardware-configuration.nix b/hosts/mauville/hardware-configuration.nix index 9785158f..00ff5cde 100644 --- a/hosts/mauville/hardware-configuration.nix +++ b/hosts/mauville/hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { @@ -9,9 +6,23 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ "kvm-amd" "amdgpu"]; boot.extraModulePackages = [ ]; + services.xserver = { + # Add AMDGPU driver. + videoDrivers = [ "amdgpu" ]; + }; + + hardware.opengl = { + enable = true; + # Add ROCM annd AMD Vulkan driver. + extraPackages = with pkgs; [ rocmPackages.clr.icd amdvlk ]; + # Add support for 32bit apps. + driSupport32Bit = true; + extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; + }; + fileSystems."/" = { device = "/dev/disk/by-uuid/c4217c88-3101-434b-8321-58e2ac89527c"; fsType = "ext4"; diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index c1d15897..953e545e 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -68,11 +68,6 @@ in { networking.hostName = "petalburg"; # Define your hostname. - hardware.sensor.iio.enable = true; - - powerManagement.powertop.enable = true; - services.thermald.enable = true; - environment.systemPackages = [ cs-adjuster cs-adjuster-plasma pp-adjuster ]; desktopConfig = { diff --git a/hosts/petalburg/hardware-configuration.nix b/hosts/petalburg/hardware-configuration.nix index 5eeacc3f..a7dfd49d 100644 --- a/hosts/petalburg/hardware-configuration.nix +++ b/hosts/petalburg/hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { @@ -12,6 +9,33 @@ boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + + # Intel drivers with accelerated video playback support. + nixpkgs.config.packageOverrides = pkgs: { + intel-vaapi-driver = + pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; + }; + + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + libvdpau-va-gl + ]; + }; + + environment.sessionVariables = { + LIBVA_DRIVER_NAME = "iHD"; + }; # Force intel-media-driver + + # Enable auto-rotate and tablet mode. + hardware.sensor.iio.enable = true; + + # Save power/better manage heat & fans. + powerManagement.powertop.enable = true; + services.thermald.enable = true; + fileSystems."/" = { device = "/dev/disk/by-uuid/ed744c02-8854-4f1a-8e75-ed15f02775e3"; fsType = "ext4"; diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index e3d6ca3b..05e19a2b 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -42,8 +42,6 @@ networking.hostName = "rustboro"; # Define your hostname. - powerManagement.cpuFreqGovernor = "ondemand"; - systemConfig = { plymouth.enable = true; zramSwap = { diff --git a/hosts/rustboro/hardware-configuration.nix b/hosts/rustboro/hardware-configuration.nix index ed4f2262..4ada3845 100644 --- a/hosts/rustboro/hardware-configuration.nix +++ b/hosts/rustboro/hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { @@ -21,6 +18,28 @@ fileSystems."/persist" = { neededForBoot = true; }; + # Otherwise, CPU doesn't automatically clock down. + powerManagement.cpuFreqGovernor = "ondemand"; + + # Intel drivers with accelerated video playback support. + nixpkgs.config.packageOverrides = pkgs: { + intel-vaapi-driver = + pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; + }; + + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + libvdpau-va-gl + ]; + }; + + environment.sessionVariables = { + LIBVA_DRIVER_NAME = "iHD"; + }; # Force intel-media-driver + networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";