diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix index c914dddfa208..4fe1af0717e7 100644 --- a/pkgs/development/libraries/xdg-desktop-portal/default.nix +++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix @@ -6,6 +6,7 @@ , docbook_xml_dtd_412 , docbook_xml_dtd_43 , docbook_xsl +, docutils , systemdMinimal , geoclue2 , glib @@ -30,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "xdg-desktop-portal"; - version = "1.17.0"; + version = "1.17.2"; outputs = [ "out" "installedTests" ]; @@ -38,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "flatpak"; repo = "xdg-desktop-portal"; rev = finalAttrs.version; - sha256 = "sha256-OGf2ohP/Qd+ff3KfJYoHu9wbCAUXCP3wm/utjqkgccE="; + sha256 = "sha256-ZNIGnoDw6bBf4k+PeBckGMFxnDfR3oVbj3cqdLY3M+Q="; }; patches = [ @@ -52,12 +53,19 @@ stdenv.mkDerivation (finalAttrs: { # Allow installing installed tests to a separate output. ./installed-tests-path.patch + + # `XDG_DESKTOP_PORTAL_DIR` originally was used for upstream tests. But we are making use + # of this in the NixOS module, this actually blocks any configs from being loaded since + # configs are not expected to be placed in a portal implementation or even under the + # `share/xdg-desktop-portal/portals/` path. + ./separate-env-for-portal-config.patch ]; nativeBuildInputs = [ docbook_xml_dtd_412 docbook_xml_dtd_43 docbook_xsl + docutils # for rst2man libxml2 meson ninja diff --git a/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch b/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch new file mode 100644 index 000000000000..020d98c20700 --- /dev/null +++ b/pkgs/development/libraries/xdg-desktop-portal/separate-env-for-portal-config.patch @@ -0,0 +1,33 @@ +diff --git a/src/portal-impl.c b/src/portal-impl.c +index 0fa9682e..99f379dc 100644 +--- a/src/portal-impl.c ++++ b/src/portal-impl.c +@@ -433,8 +433,7 @@ load_portal_configuration (gboolean opt_verbose) + + desktops = get_current_lowercase_desktops (); + +- /* We need to override this in the tests */ +- portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_DIR"); ++ portal_dir = g_getenv ("NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR_OVERRIDE"); + + if (portal_dir != NULL) + { +@@ -464,6 +463,18 @@ load_portal_configuration (gboolean opt_verbose) + if (load_config_directory (SYSCONFDIR "/" XDP_SUBDIR, desktops, opt_verbose)) + return; + ++ portal_dir = g_getenv ("NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR"); ++ ++ if (portal_dir == NULL) ++ /* We need to override this in the tests */ ++ portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_DIR"); ++ ++ if (portal_dir != NULL) ++ { ++ if (load_config_directory (portal_dir, desktops, opt_verbose)) ++ return; ++ } ++ + /* $XDG_DATA_HOME/xdg-desktop-portal/(DESKTOP-)portals.conf + * (just for consistency with other XDG specifications) */ + g_clear_pointer (&user_portal_dir, g_free);