diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index f3e5b92..2915c6a 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -1,4 +1,9 @@ -{ config, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ./hardware-configuration.nix @@ -7,6 +12,7 @@ ./power_management.nix ./screen_brightness.nix ./wifi.nix + ./framework_module.nix ]; # Generate with `head -c4 /dev/urandom | od -A none -t x4` @@ -27,8 +33,15 @@ environment.systemPackages = with pkgs; [ fw-ectool + framework-tool ]; + # Enable light sensor + # hardware.sensor.iio.enable = lib.mkDefault true; + + # Enable TRIM + # services.fstrim.enable = lib.mkDefault true; + me.alacritty.enable = true; me.ansible.enable = true; me.ares.enable = true; diff --git a/nix/configuration/hosts/odo/framework_module.nix b/nix/configuration/hosts/odo/framework_module.nix new file mode 100644 index 0000000..5a54004 --- /dev/null +++ b/nix/configuration/hosts/odo/framework_module.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + config = lib.mkMerge [ + { + boot.extraModulePackages = with config.boot.kernelPackages; [ + framework-laptop-kmod + ]; + # https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage + boot.kernelModules = [ + "cros_ec" + "cros_ec_lpcs" + ]; + } + ]; +} diff --git a/nix/configuration/roles/graphics/default.nix b/nix/configuration/roles/graphics/default.nix index 0636918..9c6eed5 100644 --- a/nix/configuration/roles/graphics/default.nix +++ b/nix/configuration/roles/graphics/default.nix @@ -37,6 +37,11 @@ xorg.xeyes # to test which windows are using x11 ]; hardware.graphics.enable = true; + # hardware.graphics.enable32Bit = true; + + # Vulkan Support (64-bit is enabled by default, 32-bit is disabled by default) + # hardware.opengl.driSupport = true; # This is already enabled by default + # hardware.opengl.driSupport32Bit = true; # For 32 bit applications }) ] ); diff --git a/nix/configuration/roles/media/default.nix b/nix/configuration/roles/media/default.nix index 165ba40..6cafc12 100644 --- a/nix/configuration/roles/media/default.nix +++ b/nix/configuration/roles/media/default.nix @@ -17,6 +17,8 @@ let buildCommand = "${old.buildCommand}\n patchShebangs $out"; }); + kernel_version_check = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.12"; + nixos_version_check = lib.versionAtLeast (lib.versions.majorMinor lib.version) "25.05"; in { imports = [ ]; @@ -35,6 +37,8 @@ in { environment.systemPackages = with pkgs; [ ffmpeg + libva-utils # for vainfo + vdpauinfo ]; } (lib.mkIf config.me.graphical { @@ -59,6 +63,21 @@ in cast_file_vaapi ]; }) + (lib.mkIf (config.me.graphics_card_type == "amd") { + environment.sessionVariables = { + VDPAU_DRIVER = "radeonsi"; + }; + }) + (lib.mkIf (config.me.graphics_card_type == "intel") { + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver + libvdpau-va-gl # Support vdpau applications using va-api + ]; + + environment.sessionVariables = { + VDPAU_DRIVER = "va_gl"; + }; + }) ] ); }