ooknet/inputs/system/modules/base/host/hardware/features/video.nix

32 lines
716 B
Nix

{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
inherit (builtins) elem;
isx86Linux = pkgs: with pkgs.stdenv; hostPlatform.isLinux && hostPlatform.isx86;
features = config.systemModules.host.hardware.features;
in
{
config = mkIf (elem "video" features) {
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = isx86Linux pkgs;
};
};
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
];
config = {
common.default = ["gtk"];
hyprland.default = ["gtk" "hyprland"];
};
};
};
}