Make NVIDIA wayland workarounds configurable
This commit is contained in:
parent
d15612b6bd
commit
293152df13
@ -59,6 +59,14 @@ in
|
||||
default = (lib.hasAttrByPath [ "nixfiles" "meta" "wayland" ] osConfig) && osConfig.nixfiles.meta.wayland;
|
||||
example = true;
|
||||
};
|
||||
|
||||
workarounds.nvidiaPrimary = lib.mkOption {
|
||||
description = "Whether to enable workarounds for NVIDIA as the primary GPU";
|
||||
default = osConfig.nixfiles.workarounds.nvidiaPrimary or false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
path = lib.mkOption {
|
||||
description = "The absolute path of the nixfiles flake";
|
||||
type = lib.types.str;
|
||||
|
@ -6,7 +6,9 @@ let
|
||||
else
|
||||
pkgs.rustdesk-flutter;
|
||||
|
||||
vesktop-ozone-cmd = "env NIXOS_OZONE_WL=1 vesktop --disable-gpu";
|
||||
vesktop-ozone-cmd = let
|
||||
extraFlags = lib.optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
||||
in "env NIXOS_OZONE_WL=1 vesktop${extraFlags}";
|
||||
in
|
||||
{
|
||||
options.nixfiles.packageSets.communication = {
|
||||
|
@ -15,7 +15,10 @@ in
|
||||
xdg.desktopEntries.obsidian = lib.mkIf config.nixfiles.meta.graphical {
|
||||
categories = [ "Office" ];
|
||||
comment = "Knowledge base";
|
||||
exec = "env NIXOS_OZONE_WL=1 obsidian --disable-gpu %u";
|
||||
exec = let
|
||||
extraFlags = with lib.strings;
|
||||
optionalString config.nixfiles.workarounds.nvidiaPrimary " --disable-gpu";
|
||||
in "env NIXOS_OZONE_WL=1 obsidian${extraFlags} %u";
|
||||
icon = "obsidian";
|
||||
mimeType = [ "x-scheme-handler/obsidian" ];
|
||||
name = "Obsidian";
|
||||
|
@ -54,6 +54,7 @@
|
||||
nixfiles = {
|
||||
profile.pc.enable = true;
|
||||
programs.adb.enable = true;
|
||||
workarounds.nvidiaPrimary = true;
|
||||
programs.greetd = {
|
||||
preset = "tuigreet";
|
||||
settings = {
|
||||
|
@ -28,6 +28,13 @@ in
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
workarounds.nvidiaPrimary = lib.mkOption {
|
||||
description = "Whether to enable workarounds for NVIDIA as the primary GPU";
|
||||
default = false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
lib = lib.mkOption {
|
||||
description = "nixfiles library";
|
||||
default = (import ../lib/nixfiles) { inherit pkgs; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user