nixos-config/sway.nix

94 lines
2.1 KiB
Nix
Raw Normal View History

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