···11{ config, pkgs, lib, ... }:
2233-with lib;
33+let
44+ inherit (lib)
55+ mkEnableOption
66+ mkIf
77+ mkOption
88+ mkRenamedOptionModule
99+ teams
1010+ types;
1111+in
412513{
614 imports = [
715 (mkRenamedOptionModule [ "services" "flatpak" "extraPortals" ] [ "xdg" "portal" "extraPortals" ])
1616+1717+ ({ config, lib, options, ... }:
1818+ let
1919+ from = [ "xdg" "portal" "gtkUsePortal" ];
2020+ fromOpt = lib.getAttrFromPath from options;
2121+ in
2222+ {
2323+ warnings = lib.mkIf config.xdg.portal.gtkUsePortal [
2424+ "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."
2525+ ];
2626+ }
2727+ )
828 ];
9291030 meta = {
···32523353 gtkUsePortal = mkOption {
3454 type = types.bool;
5555+ visible = false;
3556 default = false;
3657 description = ''
3758 Sets environment variable <literal>GTK_USE_PORTAL</literal> to <literal>1</literal>.
3838- This is needed for packages ran outside Flatpak to respect and use XDG Desktop Portals.
3939- For example, you'd need to set this for non-flatpak Firefox to use native filechoosers.
5959+ This will force GTK-based programs ran outside Flatpak to respect and use XDG Desktop Portals
6060+ for features like file chooser but it is an unsupported hack that can easily break things.
4061 Defaults to <literal>false</literal> to respect its opt-in nature.
4162 '';
4263 };