2024-08-29 05:00:20 +00:00
|
|
|
{ lib, writeTextFile }:
|
|
|
|
|
|
|
|
/* Create an XDG Portals configuration with the given desktop name and its
|
2025-01-12 09:57:14 +00:00
|
|
|
configuration. Similarly, the given desktop name is assumed to be already
|
|
|
|
in its suitable form of a lowercase ASCII.
|
2024-08-29 05:00:20 +00:00
|
|
|
*/
|
2025-01-12 09:57:14 +00:00
|
|
|
{ desktopName ? "common",
|
2024-08-29 05:00:20 +00:00
|
|
|
|
2025-01-12 09:57:14 +00:00
|
|
|
# Nix-representable data to be exported as the portal configuration.
|
|
|
|
config, }:
|
2024-08-29 05:00:20 +00:00
|
|
|
writeTextFile {
|
2025-01-12 09:57:14 +00:00
|
|
|
name = "xdg-portal-config${
|
|
|
|
lib.optionalString (desktopName != "common") "-${desktopName}"
|
|
|
|
}";
|
2024-08-29 05:00:20 +00:00
|
|
|
text = lib.generators.toINI { } config;
|
2025-01-12 09:57:14 +00:00
|
|
|
destination = "/share/xdg-desktop-portal/${
|
|
|
|
lib.optionalString (desktopName != "common") "${desktopName}-"
|
|
|
|
}portals.conf";
|
2024-08-29 05:00:20 +00:00
|
|
|
}
|