Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This factors the configuration out of the flatpak module.
- Loading branch information
1 parent
2ce67ce
commit 90b1197
Showing
6 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ config, pkgs ,lib ,... }: | ||
with lib; | ||
{ | ||
options.xdg.portal = { | ||
enable = | ||
mkEnableOption "<link xlink:href='https://github.com/flatpak/xdg-desktop-portal'>xdg desktop integration</link>"//{ | ||
default = true; | ||
}; | ||
|
||
extraPortals = mkOption { | ||
type = types.listOf types.package; | ||
default = []; | ||
description = '' | ||
List of additional portals to add to path. Portals allow interaction | ||
with system, like choosing files or taking screenshots. At minimum, | ||
a desktop portal implementation should be listed. GNOME and KDE already | ||
adds <package>xdg-desktop-portal-gtk</package>; and | ||
<package>xdg-desktop-portal-kde</package> respectively. On other desktop | ||
environments you probably want to add them yourself. | ||
''; | ||
}; | ||
}; | ||
|
||
config = | ||
let | ||
cfg = config.xdg.portal; | ||
packages = [ pkgs.xdg-desktop-portal ] ++ cfg.extraPortals; | ||
|
||
in mkIf cfg.enable { | ||
|
||
services.dbus.packages = packages; | ||
systemd.packages = packages; | ||
environment.variables = { | ||
GTK_USE_PORTAL = "1"; | ||
XDG_DESKTOP_PORTAL_PATH = map (p: "${p}/share/xdg-desktop-portal/portals") cfg.extraPortals; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters