nixos-config/sway.nix

178 lines
4.5 KiB
Nix
Raw Normal View History

2019-03-09 21:46:35 +00:00
{ config, pkgs, ... }:
{
# programs.ibus.enable = true;
# programs.ibus.plugins = [ pkgs.ibus-anthy pkgs.mozc ];
i18n.inputMethod = {
enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ mozc anthy table-other m17n ];
};
environment.systemPackages = with pkgs; with gnome3; [
i3status
2020-07-14 14:34:54 +00:00
wofi
ydotool
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-03-09 21:46:35 +00:00
fonts = {
enableDefaultFonts = false;
fonts = with pkgs; [
xorg.fontbhlucidatypewriter100dpi
xorg.fontbhlucidatypewriter75dpi
dejavu_fonts
freefont_ttf
gyre-fonts # TrueType substitutes for standard PostScript fonts
liberation_ttf
xorg.fontbh100dpi
xorg.fontmiscmisc
xorg.fontcursormisc
# unifont
wqy_microhei
inconsolata
dejavu_fonts
ipafont
ipaexfont
ubuntu_font_family
source-code-pro
fira fira-mono fira-code
noto-fonts-emoji
noto-fonts-cjk
cantarell_fonts # from gnome3 module
];
};
2020-07-14 13:09:49 +00:00
# prevent satanic torture
programs.qt5ct.enable = true;
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
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:
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)
export XDG_CURRENT_DESKTOP=X-Generic
'';
};
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:34:54 +00:00
hardware.uinput.enable = true;
users.extraUsers.gebner.extraGroups = [ "input" "tty" "audio" "video" "uinput" ];
2019-03-09 21:46:35 +00:00
# layout = "us";
# xkbVariant = "altgr-intl";
# xkbOptions = "caps:ctrl_modifier";
services.dbus.packages = with pkgs; [ mako gnome3.gcr ];
2020-07-14 13:09:49 +00:00
services.udev.packages = [ pkgs.gnome3.gnome-settings-daemon ];
2019-03-09 21:46:35 +00:00
# copied from gnome3 module
security.polkit.enable = true;
services.udisks2.enable = true;
services.accounts-daemon.enable = true;
services.geoclue2.enable = true;
services.gnome3.at-spi2-core.enable = true;
services.gnome3.gnome-keyring.enable = true;
2020-07-14 13:09:49 +00:00
services.gvfs.enable = true;
programs.seahorse.enable = true;
2019-03-09 21:46:35 +00:00
services.gnome3.sushi.enable = true;
2020-07-14 13:09:49 +00:00
services.gnome3.gnome-settings-daemon.enable = true;
2019-03-09 21:46:35 +00:00
services.telepathy.enable = true;
networking.networkmanager.enable = true;
services.upower.enable = config.powerManagement.enable;
programs.dconf.enable = true;
2020-06-22 11:15:16 +00:00
services.flatpak.enable = true;
2020-07-14 13:09:49 +00:00
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
2019-03-09 21:46:35 +00:00
# Needed for themes and backgrounds
environment.pathsToLink = [ "/share" ];
environment.variables.GIO_EXTRA_MODULES = with pkgs.gnome3; [
"${pkgs.lib.getLib dconf}/lib/gio/modules"
"${glib_networking.out}/lib/gio/modules"
"${gvfs}/lib/gio/modules" ];
hardware.bluetooth = {
enable = true;
package = pkgs.bluezFull;
};
2020-07-14 13:09:49 +00:00
services.blueman.enable = true;
2019-03-09 21:46:35 +00:00
hardware.pulseaudio = {
enable = true;
zeroconf.discovery.enable = true;
daemon.config = {
flat-volumes = "no";
2020-07-14 13:09:49 +00:00
avoid-resampling = "yes";
resample-method = "speex-float-10";
default-sample-format = "s32le";
default-sample-rate = "96000";
2019-03-09 21:46:35 +00:00
};
package = pkgs.pulseaudioFull;
extraModules = [ pkgs.pulseaudio-modules-bt ];
};
2020-07-14 13:09:49 +00:00
programs.gnupg = {
agent.enable = true;
agent.pinentryFlavor = "gnome3";
};
2019-03-09 21:46:35 +00:00
}