···1{ config, pkgs, lib, ... }:
23-with lib;
0000000045{
6 imports = [
7 (mkRenamedOptionModule [ "services" "flatpak" "extraPortals" ] [ "xdg" "portal" "extraPortals" ])
0000000000008 ];
910 meta = {
···3233 gtkUsePortal = mkOption {
34 type = types.bool;
035 default = false;
36 description = ''
37 Sets environment variable <literal>GTK_USE_PORTAL</literal> to <literal>1</literal>.
38- This is needed for packages ran outside Flatpak to respect and use XDG Desktop Portals.
39- For example, you'd need to set this for non-flatpak Firefox to use native filechoosers.
40 Defaults to <literal>false</literal> to respect its opt-in nature.
41 '';
42 };
···1{ config, pkgs, lib, ... }:
23+let
4+ inherit (lib)
5+ mkEnableOption
6+ mkIf
7+ mkOption
8+ mkRenamedOptionModule
9+ teams
10+ types;
11+in
1213{
14 imports = [
15 (mkRenamedOptionModule [ "services" "flatpak" "extraPortals" ] [ "xdg" "portal" "extraPortals" ])
16+17+ ({ config, lib, options, ... }:
18+ let
19+ from = [ "xdg" "portal" "gtkUsePortal" ];
20+ fromOpt = lib.getAttrFromPath from options;
21+ in
22+ {
23+ warnings = lib.mkIf config.xdg.portal.gtkUsePortal [
24+ "The option `${lib.showOption from}' defined in ${lib.showFiles fromOpt.files} has been deprecated. Setting the variable globally with `environment.sessionVariables' NixOS option can have unforseen side-effects."
25+ ];
26+ }
27+ )
28 ];
2930 meta = {
···5253 gtkUsePortal = mkOption {
54 type = types.bool;
55+ visible = false;
56 default = false;
57 description = ''
58 Sets environment variable <literal>GTK_USE_PORTAL</literal> to <literal>1</literal>.
59+ This will force GTK-based programs ran outside Flatpak to respect and use XDG Desktop Portals
60+ for features like file chooser but it is an unsupported hack that can easily break things.
61 Defaults to <literal>false</literal> to respect its opt-in nature.
62 '';
63 };