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;
|
default = (lib.hasAttrByPath [ "nixfiles" "meta" "wayland" ] osConfig) && osConfig.nixfiles.meta.wayland;
|
||||||
example = true;
|
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 {
|
path = lib.mkOption {
|
||||||
description = "The absolute path of the nixfiles flake";
|
description = "The absolute path of the nixfiles flake";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
@ -6,7 +6,9 @@ let
|
|||||||
else
|
else
|
||||||
pkgs.rustdesk-flutter;
|
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
|
in
|
||||||
{
|
{
|
||||||
options.nixfiles.packageSets.communication = {
|
options.nixfiles.packageSets.communication = {
|
||||||
|
@ -15,7 +15,10 @@ in
|
|||||||
xdg.desktopEntries.obsidian = lib.mkIf config.nixfiles.meta.graphical {
|
xdg.desktopEntries.obsidian = lib.mkIf config.nixfiles.meta.graphical {
|
||||||
categories = [ "Office" ];
|
categories = [ "Office" ];
|
||||||
comment = "Knowledge base";
|
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";
|
icon = "obsidian";
|
||||||
mimeType = [ "x-scheme-handler/obsidian" ];
|
mimeType = [ "x-scheme-handler/obsidian" ];
|
||||||
name = "Obsidian";
|
name = "Obsidian";
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
nixfiles = {
|
nixfiles = {
|
||||||
profile.pc.enable = true;
|
profile.pc.enable = true;
|
||||||
programs.adb.enable = true;
|
programs.adb.enable = true;
|
||||||
|
workarounds.nvidiaPrimary = true;
|
||||||
programs.greetd = {
|
programs.greetd = {
|
||||||
preset = "tuigreet";
|
preset = "tuigreet";
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -28,6 +28,13 @@ in
|
|||||||
type = lib.types.bool;
|
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 {
|
lib = lib.mkOption {
|
||||||
description = "nixfiles library";
|
description = "nixfiles library";
|
||||||
default = (import ../lib/nixfiles) { inherit pkgs; };
|
default = (import ../lib/nixfiles) { inherit pkgs; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user