mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
20 lines
635 B
Nix
20 lines
635 B
Nix
{ lib, writeTextFile }:
|
|
|
|
/* Create an XDG Portals configuration with the given desktop name and its
|
|
configuration. Similarly, the given desktop name is assumed to be already
|
|
in its suitable form of a lowercase ASCII.
|
|
*/
|
|
{ desktopName ? "common",
|
|
|
|
# Nix-representable data to be exported as the portal configuration.
|
|
config, }:
|
|
writeTextFile {
|
|
name = "xdg-portal-config${
|
|
lib.optionalString (desktopName != "common") "-${desktopName}"
|
|
}";
|
|
text = lib.generators.toINI { } config;
|
|
destination = "/share/xdg-desktop-portal/${
|
|
lib.optionalString (desktopName != "common") "${desktopName}-"
|
|
}portals.conf";
|
|
}
|