anchor.diff:        '';
       };
   
  +    extraSessionCommands = mkOption {
  +      type = types.lines;
  +      default = "";
  +      example = ''
  +        export SDL_VIDEODRIVER=wayland
  +        # needs qt5.qtwayland in systemPackages
  +        export QT_QPA_PLATFORM=wayland
  +        export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
  +        # Fix for some Java AWT applications (e.g. Android Studio),
  +        # use this if they aren't displayed properly:
  +        export _JAVA_AWT_WM_NONREPARENTING=1
  +      '';
  +      description = ''
  +        Shell commands executed just before Sway is started.
  +      '';
  +    };
  +
       extraPackages = mkOption {
         type = with types; listOf package;
         default = with pkgs; [
  -        xwayland dmenu
  +        xwayland rxvt_unicode dmenu
         ];
         defaultText = literalExample ''
  -        with pkgs; [ xwayland dmenu ];
  +        with pkgs; [ xwayland rxvt_unicode dmenu ];
         '';
         example = literalExample ''
           with pkgs; [
  
positive.code:   };
  
    config = mkIf cfg.enable {
      environment.systemPackages = [ swayPackage ] ++ cfg.extraPackages;
      security.pam.services.swaylock = {};
      hardware.opengl.enable = mkDefault true;
      fonts.enableDefaultFonts = mkDefault true;
  
negative.code: let
    cfg = config.programs.sway-beta;
    swayPackage = cfg.package;
  
    swayWrapped = pkgs.writeShellScriptBin "sway" ''
      ${cfg.extraSessionCommands}
      exec ${pkgs.dbus.dbus-launch} --exit-with-session ${swayPackage}/bin/sway
    '';
    swayJoined = pkgs.symlinkJoin {
      name = "sway-joined";
      paths = [ swayWrapped swayPackage ];
    };
  in {
    options.programs.sway-beta = {
      enable = mkEnableOption ''
  