From 4e12151c9e014e2449e0beca2c0e9534b96a26b4 Mon Sep 17 00:00:00 2001 From: CnTeng Date: Fri, 14 Mar 2025 13:19:29 +0800 Subject: [PATCH] megasync: add option to enable wayland --- modules/services/megasync.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/services/megasync.nix b/modules/services/megasync.nix index b058c01d6..19258e5dd 100644 --- a/modules/services/megasync.nix +++ b/modules/services/megasync.nix @@ -8,6 +8,13 @@ in { enable = lib.mkEnableOption "Megasync client"; package = lib.mkPackageOption pkgs "megasync" { }; + + forceWayland = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Force Megasync to run on wayland"; + }; }; }; @@ -28,7 +35,11 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; - Service = { ExecStart = "${cfg.package}/bin/megasync"; }; + Service = { + Environment = + lib.optionals cfg.forceWayland [ "DO_NOT_UNSET_XDG_SESSION_TYPE=1" ]; + ExecStart = lib.getExe' cfg.package "megasync"; + }; }; }; }