From 6687000fdaabcfcf42a79767bc79350684e0d277 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 5 Aug 2023 08:16:50 +0530 Subject: wayland: split wayland and xdg desktop portal xdp is disabled by default now, and probably will be removed later. --- features/wayland.nix | 27 ++------------------------- features/xdp.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 features/xdp.nix diff --git a/features/wayland.nix b/features/wayland.nix index 53ff77f..20e070b 100644 --- a/features/wayland.nix +++ b/features/wayland.nix @@ -1,19 +1,6 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: let - # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist - dbus-xdp-environment = pkgs.writeTextFile { - name = "dbus-xdp-environment"; - destination = "/bin/dbus-xdp-environment"; - executable = true; - - text = '' - dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=wlroots - systemctl --user stop pipewire wireplumber xdg-desktop-portal xdg-desktop-portal-wlr - systemctl --user start pipewire wireplumber xdg-desktop-portal xdg-desktop-portal-wlr - ''; - }; - # gtk theming: https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # for gsettings to work, we need to tell it where the schemas are # using the XDG_DATA_DIR environment variable @@ -43,7 +30,6 @@ in OVMFFull element-desktop firefox - dbus-xdp-environment swaylock swayidle swaybg @@ -61,21 +47,11 @@ in wlr-randr tor-browser-bundle-bin wtype - # gtk configure-gtk dracula-theme # gtk theme - gnome3.adwaita-icon-theme # default gnome cursors glib # gsettings ]; - # xdg desktop portal - services.dbus.enable = true; - xdg.portal = { - enable = true; - wlr.enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - }; - # font fonts = { fonts = [ pkgs.terminus-nerdfont pkgs.dm-sans ]; @@ -93,6 +69,7 @@ in # misc hardware.opengl.enable = true; + services.dbus.enable = true; programs = { dconf.enable = true; xwayland.enable = true; diff --git a/features/xdp.nix b/features/xdp.nix new file mode 100644 index 0000000..78ee5f8 --- /dev/null +++ b/features/xdp.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: + +let + # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist + dbus-xdp-environment = pkgs.writeTextFile { + name = "dbus-xdp-environment"; + destination = "/bin/dbus-xdp-environment"; + executable = true; + + text = '' + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=wlroots + systemctl --user stop pipewire wireplumber xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire wireplumber xdg-desktop-portal xdg-desktop-portal-wlr + ''; + }; +in +{ + # pkgs + environment.systemPackages = [ dbus-xdp-environment ]; + + # xdg desktop portal + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; +} -- cgit v1.2.3