{ lib, config, pkgs, flakeRoot, ... }: let # Use the config option defaultUser directly, fallback to "henrov" username = config.defaultUser or "henrov"; xdgPortalHyprlandPkg = pkgs.xdg-desktop-portal-hyprland; in { ################################# # Enable XDG desktop portals system-wide ################################# xdg.portal.enable = true; # Use Hyprland portal backend specifically for screencast xdg.portal.configPackages = { "org.freedesktop.impl.portal.Screencast" = [ xdgPortalHyprlandPkg ]; }; ################################# # Install portal packages system-wide ################################# environment.systemPackages = [ xdgPortalHyprlandPkg ]; ################################# # Home Manager user configuration ################################# home-manager.users = { ${username} = { home.packages = [ xdgPortalHyprlandPkg ]; }; }; }