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:
parent
992b38f29c
commit
fcbc70a7ee
6 changed files with 206 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
37
tests/modules/misc/xdg/portal.nix
Normal file
37
tests/modules/misc/xdg/portal.nix
Normal 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}
|
||||
'';
|
||||
}
|
||||
2
tests/modules/misc/xdg/sway-portals-expected.conf
Normal file
2
tests/modules/misc/xdg/sway-portals-expected.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[preferred]
|
||||
default=wlr;gtk
|
||||
Loading…
Add table
Add a link
Reference in a new issue