81 lines
2.3 KiB
Nix
Raw Normal View History

2024-01-07 00:57:22 -08:00
{ config, lib, pkgs, user, inputs, ... }:
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; [
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
libnotify
2023-07-11 21:17:48 -07:00
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-23 14:34:39 -07:00
networkmanagerapplet
2023-07-11 21:17:48 -07:00
pcmanfm
2023-07-30 08:33:11 -07:00
udiskie
2023-09-01 21:58:15 -07:00
pavucontrol
2023-12-13 23:47:17 -08:00
waybar
(pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
})
)
2023-08-21 21:05:02 -07:00
] ++ [
2024-02-05 22:55:44 -08:00
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
2023-07-10 17:52:34 -07:00
];
2023-09-12 18:59:42 -07:00
xdg = {
portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
2023-07-10 17:52:34 -07:00
};
# enable sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
2023-12-13 23:47:17 -08:00
programs.hyprland = {
2024-01-07 00:57:22 -08:00
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
2023-12-13 23:47:17 -08:00
enable = true;
xwayland.enable = true;
};
2023-07-10 17:52:34 -07:00
};
}