dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

143 lines4177 bytesNix
1# Hyprland under uwsm, the greetd login screen, audio, Bluetooth, fonts and the
2# system side of theming.
3{
4 config,
5 lib,
6 pkgs,
7 ...
8}:
9let
10 greetdFiles = ../../config/greetd;
11in
12{
13 programs.hyprland = {
14 enable = true;
15 # uwsm starts Hyprland as a systemd unit and brings up
16 # graphical-session.target, which the user services in
17 # modules/home/services.nix hang off.
18 withUWSM = true;
19 };
20 programs.hyprlock.enable = true;
21
22 xdg.portal = {
23 enable = true;
24 # File pickers and settings for GTK apps; screen sharing comes from
25 # xdg-desktop-portal-hyprland, which programs.hyprland adds.
26 extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
27 };
28
29 # --- Login screen -------------------------------------------------------------
30
31 # gtkgreet in a small Hyprland of its own, blurred over the wallpaper. Same
32 # files as /etc/greetd on CachyOS; see config/greetd.
33 services.greetd = {
34 enable = true;
35 settings = {
36 terminal.vt = 1;
37 default_session = {
38 command = "${config.programs.hyprland.package}/bin/start-hyprland -- --config /etc/greetd/hyprland.lua";
39 user = "greeter";
40 };
41 };
42 };
43 environment.etc = {
44 "greetd/hyprland.lua".source = "${greetdFiles}/hyprland.lua";
45 "greetd/hyprpaper.conf".source = "${greetdFiles}/hyprpaper.conf";
46 "greetd/style.css".source = "${greetdFiles}/style.css";
47 "greetd/session.sh".source = "${greetdFiles}/session.sh";
48 "greetd/wallpapers/wallpaper.jpg".source = ../../config/hypr/wallpaper.jpg;
49 };
50
51 # The greeter user has no settings of its own; these system-wide GSettings
52 # defaults give gtkgreet the desktop's cursor. They replace
53 # 99_greeter-cursor.gschema.override from CachyOS.
54 programs.dconf = {
55 enable = true;
56 profiles.user.databases = [
57 {
58 settings."org/gnome/desktop/interface" = {
59 cursor-theme = "BreezeX-Black";
60 cursor-size = lib.gvariant.mkInt32 28;
61 color-scheme = "prefer-dark";
62 };
63 }
64 ];
65 };
66
67 # --- Audio, Bluetooth, devices --------------------------------------------------
68
69 services.pipewire = {
70 enable = true;
71 alsa.enable = true;
72 alsa.support32Bit = true;
73 pulse.enable = true;
74 jack.enable = true;
75 };
76 services.pulseaudio.enable = false;
77
78 hardware.bluetooth = {
79 enable = true;
80 powerOnBoot = true;
81 };
82 services.blueman.enable = true;
83
84 services.upower.enable = true;
85 services.udisks2.enable = true;
86 services.gvfs.enable = true;
87 security.polkit.enable = true;
88 # Secret Service (what Electron apps and libsecret store passwords in) from
89 # KWallet's ksecretd, started on demand over D-Bus, as on CachyOS. Not GNOME
90 # Keyring: it would claim the same D-Bus name.
91 services.dbus.packages = [ pkgs.kdePackages.kwallet ];
92
93 # Battery of the Logitech mouse in the control centre (mouse-battery.sh).
94 hardware.logitech.wireless.enable = true;
95
96 # --- Fonts -------------------------------------------------------------------
97
98 # The fonts installed on CachyOS. kitty.conf asks for JetBrains Mono, which
99 # was never installed there, so kitty has been using Noto Sans Mono; add
100 # nerd-fonts.jetbrains-mono here to get the font the config names.
101 fonts.packages = with pkgs; [
102 noto-fonts
103 noto-fonts-cjk-sans
104 noto-fonts-color-emoji
105 nerd-fonts.noto
106 nerd-fonts.meslo-lg
107 nerd-fonts.fantasque-sans-mono
108 dejavu_fonts
109 liberation_ttf
110 ttf-bitstream-vera
111 open-sans
112 cantarell-fonts
113 adwaita-fonts
114 font-awesome
115 wqy_zenhei
116 ];
117
118 # --- Theming (system side) ------------------------------------------------------
119
120 # Qt apps use qt6ct + Kvantum (QT_QPA_PLATFORMTHEME is set in hyprland.lua).
121 qt = {
122 enable = true;
123 platformTheme = "qt5ct";
124 style = "kvantum";
125 };
126
127 environment.systemPackages = with pkgs; [
128 # The greeter runs these from /etc/greetd/hyprland.lua.
129 gtkgreet
130 hyprpaper
131 kitty
132 procps
133
134 breezex-cursor
135 papirus-icon-theme
136 kdePackages.breeze-icons
137 gnome-themes-extra
138 adwaita-icon-theme
139 kdePackages.qtstyleplugin-kvantum
140 libsForQt5.qtstyleplugin-kvantum
141 qt6Packages.qt6ct
142 ];
143}