ooknet/nixos/modules/host/hardware/features/video.nix

33 lines
747 B
Nix

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