nixos-config/sway.nix

82 lines
1.8 KiB
Nix

{ config, pkgs, ... }:
{
imports = [
./common-gui.nix
];
environment.systemPackages = with pkgs; with gnome3; [
i3status
(waybar.override { pulseSupport = true; })
wofi
ydotool
wl-clipboard
feh
gnome_keyring
networkmanagerapplet
pcmanfm
evince
grim
mako
pavucontrol
paprefs
dconf-editor
xdg_utils # for xdg-open
# gnome3 core packages
desktop_file_utils shared_mime_info
glib gtk3
glib_networking gvfs dconf
gnome_themes_standard defaultIconTheme
hicolor_icon_theme
# for QT_QPA_PLATFORM=wayland
qt5.qtwayland
wdisplays
];
nixpkgs.config.packageOverrides = pkgs: with pkgs; {
firefox = firefox-wayland;
};
services.dbus.socketActivated = true;
programs.sway = {
enable = true;
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
# https://github.com/swaywm/sway/issues/4506
export QT_QPA_PLATFORM=xcb
# 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
# rust winit's wayland support is broken for input methods
export WINIT_UNIX_BACKEND=x11
export XDG_DATA_DIRS=/run/current-system/sw/share/''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS
export $(${pkgs.gnome3.gnome_keyring}/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg)
export XDG_CURRENT_DESKTOP=sway
'';
};
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.lightdm.enable = true;
displayManager.defaultSession = "sway";
};
services.dbus.packages = with pkgs; [ mako ];
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
}