mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
hyprland: add xdg.portal configuration
Add integration with `xdg.portal`, and the `portalPackage` option for `xdg-desktop-portal-hyprland`.
This commit is contained in:
parent
c7c2517612
commit
077f0cb14d
1 changed files with 20 additions and 0 deletions
|
@ -58,6 +58,8 @@ in {
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "hyprland" { };
|
package = lib.mkPackageOption pkgs "hyprland" { };
|
||||||
|
|
||||||
|
portalPackage = lib.mkPackageOption pkgs "xdg-desktop-portal-hyprland" { };
|
||||||
|
|
||||||
finalPackage = lib.mkOption {
|
finalPackage = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
|
@ -69,6 +71,18 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
finalPortalPackage = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
readOnly = true;
|
||||||
|
default = cfg.portalPackage.override { hyprland = cfg.finalPackage; };
|
||||||
|
defaultText = lib.literalMD ''
|
||||||
|
`wayland.windowManager.hyprland.portalPackage` with
|
||||||
|
`wayland.windowManager.hyprland.finalPackage` override'';
|
||||||
|
description = ''
|
||||||
|
The xdg-desktop-portal-hyprland package after overriding its hyprland input.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
plugins = lib.mkOption {
|
plugins = lib.mkOption {
|
||||||
type = with lib.types; listOf (either package path);
|
type = with lib.types; listOf (either package path);
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
@ -264,6 +278,12 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = [ cfg.finalPortalPackage ];
|
||||||
|
configPackages = lib.mkDefault [ cfg.finalPackage ];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemd.enable {
|
systemd.user.targets.hyprland-session = lib.mkIf cfg.systemd.enable {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Hyprland compositor session";
|
Description = "Hyprland compositor session";
|
||||||
|
|
Loading…
Reference in a new issue