nix/module: add nvidiaPatches option

Also fixes wrong package passing.
This commit is contained in:
Mihai Fufezan 2022-12-15 20:53:20 +02:00
parent 85f50a4a13
commit f59c9a805e
No known key found for this signature in database
GPG key ID: 5899325F2F120900

View file

@ -11,6 +11,7 @@ with lib; let
defaultHyprlandPackage = inputs.self.packages.${pkgs.system}.default.override { defaultHyprlandPackage = inputs.self.packages.${pkgs.system}.default.override {
enableXWayland = cfg.xwayland.enable; enableXWayland = cfg.xwayland.enable;
hidpiXWayland = cfg.xwayland.hidpi; hidpiXWayland = cfg.xwayland.hidpi;
nvidiaPatches = cfg.nvidiaPatches;
}; };
in { in {
imports = [ imports = [
@ -53,6 +54,15 @@ in {
}; };
}; };
nvidiaPatches = mkOption {
type = types.bool;
default = false;
example = liberalExpression "true";
description = ''
Patch wlroots for better Nvidia support.
'';
};
recommendedEnvironment = mkOption { recommendedEnvironment = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -66,7 +76,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment = { environment = {
systemPackages = lib.optional (cfg.package != null) defaultHyprlandPackage; systemPackages = lib.optional (cfg.package != null) cfg.package;
sessionVariables = mkIf cfg.recommendedEnvironment { sessionVariables = mkIf cfg.recommendedEnvironment {
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
@ -79,14 +89,14 @@ in {
xwayland.enable = mkDefault true; xwayland.enable = mkDefault true;
}; };
security.polkit.enable = true; security.polkit.enable = true;
services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) defaultHyprlandPackage; services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
xdg.portal = { xdg.portal = {
enable = mkDefault true; enable = mkDefault true;
# xdg-desktop-portal-hyprland # xdg-desktop-portal-hyprland
extraPortals = lib.mkIf (cfg.package != null) [ extraPortals = lib.mkIf (cfg.package != null) [
(inputs.xdph.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override { (inputs.xdph.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
hyprland-share-picker = inputs.xdph.packages.${pkgs.system}.hyprland-share-picker.override { hyprland-share-picker = inputs.xdph.packages.${pkgs.system}.hyprland-share-picker.override {
hyprland = defaultHyprlandPackage; hyprland = cfg.package;
}; };
}) })
]; ];