From 64b4a24047eb681730da1cb89eae01ff48bd8369 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Thu, 1 Aug 2019 17:51:51 -0400 Subject: [PATCH] nixos/xdg/portal: set GTK_USE_PORTAL with lib.mkIf If lib.optional is given a false value it will return an empty list. Thusly the set-environment script can have ``` export GTK_USE_PORTAL= ``` This can rub certain bugs the wrong way #65679 so lets make sure this isn't set in the environment at all. --- nixos/modules/config/xdg/portal.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/xdg/portal.nix b/nixos/modules/config/xdg/portal.nix index 89ddf80b575..bdbbfda2bb4 100644 --- a/nixos/modules/config/xdg/portal.nix +++ b/nixos/modules/config/xdg/portal.nix @@ -51,7 +51,7 @@ with lib; systemd.packages = packages; environment.variables = { - GTK_USE_PORTAL = optional cfg.gtkUsePortal "1"; + GTK_USE_PORTAL = mkIf cfg.gtkUsePortal "1"; XDG_DESKTOP_PORTAL_PATH = map (p: "${p}/share/xdg-desktop-portal/portals") cfg.extraPortals; }; };