nixos_config/hosts/common/wm/sway.nix

102 lines
3.1 KiB
Nix
Raw Normal View History

2025-12-02 21:38:59 +01:00
{ config, pkgs, lib, hostName, ... }:
2025-08-24 16:05:54 +02:00
{
environment.systemPackages = with pkgs; [
2026-01-27 12:46:36 +01:00
pavucontrol
2025-12-01 22:40:14 +01:00
libinput
libinput-gestures
2026-01-08 18:05:08 +01:00
libnotify
2025-12-01 22:40:14 +01:00
wmctrl
2026-01-08 18:05:08 +01:00
playerctl
# MIME utilities
xdg-utils
shared-mime-info
# GNOME utilities
libsecret # Keyring backend
2025-12-04 15:40:58 +01:00
gnome-text-editor
2026-01-08 18:05:08 +01:00
loupe
evince
seahorse
2025-12-04 15:40:58 +01:00
nautilus
2025-08-24 16:05:54 +02:00
];
2025-12-04 15:40:58 +01:00
2025-08-24 16:05:54 +02:00
# enable Sway window manager
programs = {
sway = {
enable = true;
2025-12-02 19:21:57 +01:00
wrapperFeatures.base = true;
2025-08-24 16:05:54 +02:00
wrapperFeatures.gtk = true;
2025-12-02 19:21:57 +01:00
extraOptions = [
"--unsupported-gpu"
];
extraPackages = with pkgs; [
2026-01-08 18:05:08 +01:00
swayidle # idle management
swaylock # screen locker
swaybg # wallpaper setting tool
grim # screenshot tool
slurp # selection tool for screenshots
wl-clipboard # clipboard support (mostly for grim/slurp)
pulseaudio # pulseaudio support
sway-contrib.grimshot # screenshot tool
kitty # terminal emulator
dotool # tool to send keyboard/mouse input to wayland apps
mako # notification system developed by swaywm maintainer
2025-12-02 19:21:57 +01:00
];
2025-08-24 16:05:54 +02:00
}; # end sway
2026-01-08 18:05:08 +01:00
uwsm = { # responsible for creating xdg-portal and systemd insteraction for sway
2025-12-04 15:40:58 +01:00
enable = true;
waylandCompositors = {
sway = {
prettyName = "Sway";
comment = "Sway compositor managed by UWSM";
binPath = "${pkgs.sway}/bin/sway";
extraArgs = [ "--unsupported-gpu" ];
};
};
}; # end uwsm
2025-08-24 16:05:54 +02:00
light = {
enable = true;
}; # end light
2025-12-02 19:21:57 +01:00
dconf.enable = true;
seahorse.enable = true;
2025-08-24 16:05:54 +02:00
}; # end programs
2025-08-25 10:01:53 +02:00
security = {
polkit.enable = true;
pam.services = {
greetd.enableGnomeKeyring = true;
greetd-password.enableGnomeKeyring = true;
login.enableGnomeKeyring = true;
2025-12-02 21:38:59 +01:00
swaylock = {
text = ''
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so
auth include login
'';
}; # end swaylock
2025-08-25 10:01:53 +02:00
}; # end pam.services
}; # end security
2025-08-24 16:05:54 +02:00
services = {
greetd = {
enable = true;
settings = {
default_session = {
2025-12-06 23:47:07 +01:00
command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd 'uwsm start -- sway-uwsm.desktop' --remember --asterisks''";
2025-08-24 16:05:54 +02:00
user = "greeter";
}; # end default_session
}; # end settings
}; # end greetd
logind = {
2025-12-02 19:21:57 +01:00
settings = {
Login = {
HandleLidSwitch = "suspend";
HandleLidSwitchExternalPower = "suspend";
};
};
2025-08-24 16:05:54 +02:00
}; # end logind
2025-12-02 19:21:57 +01:00
dbus.packages = [ pkgs.seahorse pkgs.gnome-keyring pkgs.gcr ];
2026-01-08 18:05:08 +01:00
gnome.gcr-ssh-agent.enable = true; # SSH key management via gnome keyring
gvfs.enable = true; # some support for nautilus operations
2025-08-24 16:05:54 +02:00
}; # end services
2026-01-08 18:05:08 +01:00
users.users.alisceon.extraGroups = [ "video" "input" ]; # input group required for libinput-gestures
2025-08-24 16:05:54 +02:00
}