87 lines
2.5 KiB
Nix
Raw Normal View History

2023-08-21 21:05:02 -07:00
{ config, lib, pkgs, pkgs-unstable, user, ... }:
2023-07-10 17:52:34 -07:00
let
cfg = config.modules.desktop.sway;
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# the suggested way to set gtk settings is with gsettings
# for gsettings to work, we need to tell it where the schemas are
# using the XDG_DATA_DIR environment variable
# run at the end of sway config
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in ''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Dracula'
'';
};
in {
options.modules.desktop.sway.enable = lib.mkEnableOption "sway";
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
2023-07-11 21:17:48 -07:00
alacritty
2023-07-10 17:52:34 -07:00
sway
2023-07-11 21:17:48 -07:00
swayidle
swaybg
sway-scratchpad
2023-07-11 21:17:48 -07:00
grim # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer
wdisplays # tool to configure displays
playerctl
2023-07-10 17:52:34 -07:00
wayland
xwayland
configure-gtk
xdg-utils # for opening default programs when clicking links
glib # gsettings
dracula-theme # gtk theme
gnome3.adwaita-icon-theme # default gnome cursors
2023-07-11 21:17:48 -07:00
bc
fzf
# From home config
2023-07-23 14:34:39 -07:00
networkmanagerapplet
2023-07-11 21:17:48 -07:00
pcmanfm
google-chrome
gamemode
discord
inkscape
libreoffice-fresh
mpv
2023-07-30 08:33:11 -07:00
udiskie
2023-08-21 21:05:02 -07:00
p7zip
] ++ [
pkgs-unstable.firefox
2023-07-10 17:52:34 -07:00
];
# xdg-desktop-portal works by exposing a series of D-Bus interfaces
# known as portals under a well-known name
# (org.freedesktop.portal.Desktop) and object path
# (/org/freedesktop/portal/desktop).
# The portal interfaces include APIs for file access, opening URIs,
# printing and others.
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
# gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
# enable sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
};
}