{ lib, config, pkgs, ... }: let inherit (lib) mkIf mkDefault; cfg = config.desktops; in { imports = [ ./binds.nix ./config.nix ./idle.nix ]; config = mkIf cfg.sway { desktops.wayland = true; xdg.portal = { config = { sway.common = ["gtk" "wlr"]; }; extraPortals = with pkgs; [ xdg-desktop-portal-wlr ]; }; programs.sway = { enable = true; package = pkgs.swayfx; wrapperFeatures = { base = false; gtk = false; }; }; home-manager.users.${config.user} = { wayland.windowManager.sway = { enable = true; package = pkgs.swayfx; # FIXME: this is bad, but swayfx cannot build if set :( checkConfig = false; xwayland = true; systemd.enable = true; }; }; }; }