diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 3ad57cbe3f17..81c0e9826e26 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -259,6 +259,8 @@ - `ffmpeg_5` has been removed. Please use the unversioned `ffmpeg`, pin a newer version, or if necessary pin `ffmpeg_4` for compatibility. +- The `xdg.portal.gtkUsePortal` option has been removed, as it had been deprecated for over 2 years. Using the `GTK_USE_PORTAL` environment variable in this manner is not intended nor encouraged by the GTK developers, but can still be done manually via `environment.sessionVariables`. + ## Other Notable Changes {#sec-release-24.11-notable-changes} diff --git a/nixos/modules/config/xdg/portal.nix b/nixos/modules/config/xdg/portal.nix index 2368ca04a49e..ec4e13169fa3 100644 --- a/nixos/modules/config/xdg/portal.nix +++ b/nixos/modules/config/xdg/portal.nix @@ -6,6 +6,7 @@ let mkIf mkOption mkRenamedOptionModule + mkRemovedOptionModule teams types; @@ -17,18 +18,7 @@ in { imports = [ (mkRenamedOptionModule [ "services" "flatpak" "extraPortals" ] [ "xdg" "portal" "extraPortals" ]) - - ({ config, lib, options, ... }: - let - from = [ "xdg" "portal" "gtkUsePortal" ]; - fromOpt = lib.getAttrFromPath from options; - in - { - warnings = lib.mkIf config.xdg.portal.gtkUsePortal [ - "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 unforeseen side-effects." - ]; - } - ) + (mkRemovedOptionModule [ "xdg" "portal" "gtkUsePortal" ] "This option has been removed due to being unsupported and discouraged by the GTK developers.") ]; meta = { @@ -54,18 +44,6 @@ in ''; }; - gtkUsePortal = mkOption { - type = types.bool; - visible = false; - default = false; - description = '' - Sets environment variable `GTK_USE_PORTAL` to `1`. - This will force GTK-based programs ran outside Flatpak to respect and use XDG Desktop Portals - for features like file chooser but it is an unsupported hack that can easily break things. - Defaults to `false` to respect its opt-in nature. - ''; - }; - xdgOpenUsePortal = mkOption { type = types.bool; default = false; @@ -154,7 +132,6 @@ in ]; sessionVariables = { - GTK_USE_PORTAL = mkIf cfg.gtkUsePortal "1"; NIXOS_XDG_OPEN_USE_PORTAL = mkIf cfg.xdgOpenUsePortal "1"; NIX_XDG_DESKTOP_PORTAL_DIR = "/run/current-system/sw/share/xdg-desktop-portal/portals"; };