nixos-config/sway.nix

94 lines
2.1 KiB
Nix
Raw Normal View History

2019-03-09 21:46:35 +00:00
{ config, pkgs, ... }:
{
2020-07-14 14:47:09 +00:00
imports = [
./common-gui.nix
];
2019-03-09 21:46:35 +00:00
environment.systemPackages = with pkgs; with gnome3; [
i3status
2020-08-22 13:09:54 +00:00
((waybar.override { pulseSupport = true; }).overrideDerivation (_: {
patches = [
./fix-waybar.patch
];
}))
2020-07-14 14:34:54 +00:00
wofi
ydotool
2020-08-17 09:02:28 +00:00
wl-clipboard
2019-03-09 21:46:35 +00:00
feh
gnome_keyring
networkmanagerapplet
2019-10-11 11:04:41 +00:00
pcmanfm
2019-03-09 21:46:35 +00:00
evince
2019-03-10 08:53:33 +00:00
grim
mako
2019-03-09 21:46:35 +00:00
pavucontrol
dconf-editor
2019-03-10 16:57:25 +00:00
xdg_utils # for xdg-open
2019-03-09 21:46:35 +00:00
# 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
2020-07-14 13:09:49 +00:00
wdisplays
(pkgs.writeScriptBin "gsd-xsettings"
''
#!/bin/sh
exec ${pkgs.gnome3.gnome-settings-daemon}/libexec/gsd-xsettings "$@"
'')
2019-03-09 21:46:35 +00:00
];
2020-07-14 13:09:49 +00:00
nixpkgs.config.packageOverrides = pkgs: with pkgs; {
firefox = firefox-wayland;
};
2019-05-14 14:14:18 +00:00
programs.sway = {
2019-03-09 21:46:35 +00:00
enable = true;
extraSessionCommands = ''
if [ ! "$DBUS_SESSION_BUS_ADDRESS" ]; then
exec ${pkgs.dbus}/bin/dbus-run-session "$0" "$@"
fi
export DBUS_SESSION_BUS_ADDRESS
export SDL_VIDEODRIVER=wayland
2020-07-16 10:40:19 +00:00
# https://github.com/swaywm/sway/issues/4506
export QT_QPA_PLATFORM=xcb
# export QT_QPA_PLATFORM=wayland
2019-03-09 21:46:35 +00:00
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
2019-03-10 08:53:33 +00:00
export _JAVA_AWT_WM_NONREPARENTING=1
2019-03-09 21:46:35 +00:00
2020-07-14 13:09:49 +00:00
# rust winit's wayland support is broken for input methods
export WINIT_UNIX_BACKEND=x11
2019-03-09 21:46:35 +00:00
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)
2020-07-16 12:49:42 +00:00
export XDG_CURRENT_DESKTOP=sway
2019-03-09 21:46:35 +00:00
'';
};
2020-07-14 13:09:49 +00:00
services.xserver = {
enable = true;
libinput.enable = true;
displayManager.lightdm.enable = true;
displayManager.defaultSession = "sway";
};
2020-07-14 14:47:09 +00:00
services.dbus.packages = with pkgs; [ mako ];
2020-07-14 13:09:49 +00:00
2020-07-16 12:49:42 +00:00
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
2019-03-09 21:46:35 +00:00
}