dot

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

117 lines3789 bytesNix
1# Hyprland under uwsm, logging in on tty1, audio, Bluetooth, fonts and the
2# system side of theming.
3{
4 pkgs,
5 ...
6}:
7{
8 programs.hyprland = {
9 enable = true;
10 # uwsm starts Hyprland as a systemd unit and brings up
11 # graphical-session.target, which the user services in
12 # modules/home/services.nix hang off.
13 withUWSM = true;
14 };
15 programs.hyprlock.enable = true;
16
17 xdg.portal = {
18 enable = true;
19 # File pickers and settings for GTK apps; screen sharing comes from
20 # xdg-desktop-portal-hyprland, which programs.hyprland adds.
21 extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
22 };
23
24 # --- Login --------------------------------------------------------------------
25
26 # No display manager: tty1 logs you in automatically and its login shell starts
27 # Hyprland. The session comes up locked, though: hyprlock runs first and the
28 # rest of the desktop (graphical-session.target) waits until it is unlocked;
29 # see login-lock in modules/home/desktop.nix.
30 services.getty.autologinUser = "vizie";
31
32 # In /etc/profile and /etc/zprofile, after the session variables. The tty test
33 # comes first so that uwsm's environment preloader, which reads the profile
34 # too, skips this without running uwsm. The VT is briefly visible before
35 # Hyprland takes over the screen, so clear it, hide the text cursor, and keep
36 # uwsm's startup report off it; Hyprland logs to the journal.
37 environment.loginShellInit = ''
38 if [ "$(tty)" = /dev/tty1 ] && uwsm check may-start -q; then
39 printf '\033[2J\033[3J\033[H\033[?25l'
40 exec uwsm start hyprland-uwsm.desktop >/dev/null 2>&1
41 fi
42 '';
43
44 # Home Manager's dconf.settings (theming.nix, services.nix) need it.
45 programs.dconf.enable = true;
46
47 # --- Audio, Bluetooth, devices --------------------------------------------------
48
49 services.pipewire = {
50 enable = true;
51 alsa.enable = true;
52 alsa.support32Bit = true;
53 pulse.enable = true;
54 jack.enable = true;
55 };
56 services.pulseaudio.enable = false;
57
58 hardware.bluetooth = {
59 enable = true;
60 powerOnBoot = true;
61 };
62 services.blueman.enable = true;
63
64 services.upower.enable = true;
65 services.udisks2.enable = true;
66 services.gvfs.enable = true;
67 security.polkit.enable = true;
68 # Secret Service (what Electron apps and libsecret store passwords in) from
69 # KWallet's ksecretd, started on demand over D-Bus, as on CachyOS. Not GNOME
70 # Keyring: it would claim the same D-Bus name.
71 services.dbus.packages = [ pkgs.kdePackages.kwallet ];
72
73 # Battery of the Logitech mouse in the control centre (mouse-battery.sh).
74 hardware.logitech.wireless.enable = true;
75
76 # --- Fonts -------------------------------------------------------------------
77
78 # The fonts installed on CachyOS. kitty's config asks for JetBrains Mono, which
79 # was never installed there, so kitty has been using Noto Sans Mono; add
80 # nerd-fonts.jetbrains-mono here to get the font the config names.
81 fonts.packages = with pkgs; [
82 noto-fonts
83 noto-fonts-cjk-sans
84 noto-fonts-color-emoji
85 nerd-fonts.noto
86 nerd-fonts.meslo-lg
87 nerd-fonts.fantasque-sans-mono
88 dejavu_fonts
89 liberation_ttf
90 ttf-bitstream-vera
91 open-sans
92 cantarell-fonts
93 adwaita-fonts
94 font-awesome
95 wqy_zenhei
96 ];
97
98 # --- Theming (system side) ------------------------------------------------------
99
100 # Qt apps use qt6ct + Kvantum (set up by Home Manager, modules/home/theming.nix).
101 qt = {
102 enable = true;
103 platformTheme = "qt5ct";
104 style = "kvantum";
105 };
106
107 environment.systemPackages = with pkgs; [
108 breezex-cursor
109 papirus-icon-theme
110 kdePackages.breeze-icons
111 gnome-themes-extra
112 adwaita-icon-theme
113 kdePackages.qtstyleplugin-kvantum
114 libsForQt5.qtstyleplugin-kvantum
115 qt6Packages.qt6ct
116 ];
117}