nix/module/Sway.nix

81 lines
1.6 KiB
Nix
Raw Normal View History

2024-03-28 04:27:37 +03:00
{ pkgs, lib, ... }: {
2024-03-28 07:51:33 +03:00
imports = [
./desktop/App.nix
./desktop/Dconf.nix
./desktop/Sound.nix
];
2024-03-28 04:27:37 +03:00
xdg.mime.defaultApplications = {
# Use `file -i file.txt` to find file mime type.
# Use `xdg-mime query default "text/plain"` to find default app.
"application/pdf" = "org.gnome.Evince.desktop"; # TODO: Different apps?
2024-03-28 04:27:37 +03:00
"application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop";
"audio/*" = "mpv.desktop";
"image/*" = "org.gnome.Loupe.desktop";
"text/*" = "nvim.desktop";
"video/*" = "mpv.desktop";
};
# Extra apps.
services.gnome.gnome-keyring.enable = lib.mkForce false;
environment.systemPackages = with pkgs; [
grim # Screenshot.
mako # Notification system.
2024-03-28 08:03:33 +03:00
pamixer # Audio.
2024-03-28 09:01:08 +03:00
pavucontrol # Audio.
2024-03-28 08:03:33 +03:00
pulseaudio # Audio.
slurp # Screenshot.
wl-clipboard # Clipboard.
2024-03-28 04:27:37 +03:00
];
# Sway.
programs.sway = {
enable = true;
wrapperFeatures = {
base = true;
gtk = true;
};
extraOptions = [
"--config=${./sway/Config}"
];
};
2024-03-28 10:09:22 +03:00
# Portals.
2024-03-28 10:27:07 +03:00
xdg.portal = {
2024-03-28 10:09:22 +03:00
enable = true;
2024-03-28 11:02:30 +03:00
extraPortals = with pkgs; [
xdg-desktop-portal-gnome
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
];
2024-03-28 10:27:07 +03:00
config = {
common = {
default = [
"gtk"
2024-03-28 11:02:30 +03:00
"wlr"
"gnome"
"kde"
2024-03-28 10:27:07 +03:00
];
};
};
wlr = {
enable = true;
};
2024-03-28 11:02:30 +03:00
xdgOpenUsePortal = true;
2024-03-28 10:09:22 +03:00
};
# Brightness control.
programs.light.enable = true;
# Configs.
2024-03-28 04:27:37 +03:00
environment.variables = {
2024-03-28 05:55:16 +03:00
FOOT_CONFIG = ./foot/Foot.ini;
SWAY_CONFIG = ./sway/module;
2024-03-28 04:27:37 +03:00
};
2024-03-28 06:57:21 +03:00
2024-03-28 07:41:56 +03:00
# Extra performance.
security.pam.loginLimits = [
{ domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
];
2024-03-28 04:27:37 +03:00
}