-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyprland.nix
175 lines (155 loc) · 5.24 KB
/
hyprland.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# Configure hyprland window manager
# this config file contains package, portal and services declaration
# made specifically for hyprland
{ lib, pkgs, inputs, ... }:
let
pkgs-hyprland = inputs.hyprland.packages.${pkgs.system};
python-packages = pkgs.python3.withPackages (ps: with ps; [
requests # requests module
sh # subprocess module
pyquery
]);
in
{
# Enable Hyprland Window Manager
programs.hyprland = {
enable = true;
package = pkgs-hyprland.hyprland;
systemd.setPath.enable = true;
};
programs.waybar.enable = true; # enable waybar launcher
# Enable GDM with wayland
services.xserver.displayManager.gdm = {
enable = true;
wayland = true;
banner = ''
Welcome Traveler, Behold!
You are about to enter the realm of Hyprland
'';
};
# hyprland portal is already included, gtk is also needed for compatibility
xdg.portal.extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
## QT theming ##
qt.enable = true;
qt.style = "kvantum";
qt.platformTheme = "qt5ct";
## Configure essential programs ##
programs = {
evince.enable = true; # document viewer
file-roller.enable = true; # archive manager
# Xfce file manager
thunar = {
enable = true;
plugins = with pkgs.xfce; [
exo
mousepad # text editor
thunar-archive-plugin # archive manager
thunar-volman
];
};
};
services.gnome = {
sushi.enable = true; # quick previewer for nautilus
glib-networking.enable = true; # network extensions libs
};
services.tumbler.enable = true; # thumbnailer service
## Configure essential packages ##
environment.systemPackages =
(with pkgs; [
# Hyprland Stuff main
cava # audio visualizer
cliphist # clipboard history
grim # screenshots
jq # json parser
networkmanagerapplet
nwg-look # theme switcher
openssl # required by Rainbow borders
pamixer
pavucontrol # audio control
playerctl # media player control
polkit_gnome # needed for apps requesting root access
python-packages # needed for Weather.py from dotfiles
pywal
rofi-wayland
slurp # screenshots
swappy # screenshots
swayidle # idle manager
swaylock-effects # swaylock with effects
swaynotificationcenter # notification daemon
swww
wlsunset # for night mode
wl-clipboard
wlogout
yad
gsettings-desktop-schemas
wlr-randr # xrandr but for wayland
ydotool
## Graphical apps ##
gnome.gnome-system-monitor # system monitor
gnome.eog # eye of gnome, image viewer
kitty # default terminal on hyprland
linux-wifi-hotspot # for wifi hotspot
(mpv-unwrapped.override { # mpv with more features
jackaudioSupport = true;
vapoursynthSupport = true;
}) # for video playback, needed for some scripts
mpvScripts.mpris
gnome.nautilus # file manager
shotcut # video editor
## QT theming and apps support ##
qt5.qtwayland
qt6.qmake
qt6.qtwayland
## Utilities ##
desktop-file-utils
shared-mime-info
xdg-utils
xdg-user-dirs
xorg.xhost # needed for some packages running x11 like gparted
## Hypr ecosystem ##
hyprcursor
# hyprpicker # does not work
# hyprpaper # alternative to swww
# hyprlock # alternative to swaylock
# hypridle # alternative to swayidle
pyprland # hyprland plugin support
])
++
(with pkgs-hyprland; [
# list of latest packages from hyprland repo
hyprland-protocols
]);
# Environment variables to start the session with
environment.sessionVariables = {
GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas";
# WLR_NO_HARDWARE_CURSORS = "1"; # cursor not visible, needed for nvidia
NIXOS_OZONE_WL = "1"; # for electron and chromium apps to run on wayland
MOZ_ENABLE_WAYLAND = "1"; # firefox should always run on wayland
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1"; # On tiling window managers like hyprland this is needed for java apps
CLUTTER_BACKEND = "wayland";
GDK_BACKEND = "wayland,x11"; # GTK: use wayland if possible, else X11
QT_QPA_PLATFORM = "wayland;xcb"; # QT: use wayland if possible, else X11
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
GTK_USE_PORTAL = "1"; # makes dialogs (file opening) consistent with rest of the ui
# WLR_RENDERER = "vulkan"; # vulkan not supported in hyprland
};
systemd = {
# Polkit starting systemd service - needed for apps requesting root access
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
}