1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

xdg-portal: add new module

This commit is contained in:
Gabriel Fontes 2023-11-27 16:14:31 -03:00 committed by Robert Helgesson
parent 992b38f29c
commit fcbc70a7ee
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
6 changed files with 206 additions and 0 deletions

View file

@ -5,4 +5,5 @@
xdg-file-gen = ./file-gen.nix;
xdg-default-locations = ./default-locations.nix;
xdg-user-dirs-null = ./user-dirs-null.nix;
xdg-portal = ./portal.nix;
}

View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
lib.mkIf config.test.enableBig {
xdg.portal = {
enable = true;
extraPortals =
[ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-wlr ];
configPackages = [ pkgs.hyprland ];
config = { sway.default = [ "wlr" "gtk" ]; };
};
nmt.script = ''
xdgDesktopPortal=home-files/.config/systemd/user/xdg-desktop-portal.service
assertFileExists $xdgDesktopPortal
xdgDesktopPortalWlr=home-path/share/systemd/user/xdg-desktop-portal-wlr.service
assertFileExists $xdgDesktopPortalWlr
xdgDesktopPortalHyprland=home-path/share/systemd/user/xdg-desktop-portal-hyprland.service
assertFileExists $xdgDesktopPortalHyprland
portalsDir="$(cat $TESTED/$xdgDesktopPortal | grep Environment=XDG_DESKTOP_PORTAL_DIR | cut -d '=' -f3)"
portalConfigsDir="$(cat $TESTED/$xdgDesktopPortal | grep Environment=NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR | cut -d '=' -f3)"
assertFileContent $portalsDir/hyprland.portal \
${pkgs.xdg-desktop-portal-hyprland}/share/xdg-desktop-portal/portals/hyprland.portal
assertFileContent $portalsDir/wlr.portal \
${pkgs.xdg-desktop-portal-wlr}/share/xdg-desktop-portal/portals/wlr.portal
assertFileContent $portalConfigsDir/hyprland-portals.conf \
${pkgs.hyprland}/share/xdg-desktop-portal/hyprland-portals.conf
assertFileContent $portalConfigsDir/sway-portals.conf \
${./sway-portals-expected.conf}
'';
}

View file

@ -0,0 +1,2 @@
[preferred]
default=wlr;gtk