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.
This commit is contained in:
worldofpeace 2019-08-01 17:51:51 -04:00
parent c2c77e7824
commit 64b4a24047

View file

@ -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;
};
};