dot

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

124 lines5402 bytesMarkdown
1# dot
2
3NixOS configuration for `desktop`: the CachyOS setup from
4[Eiziv/dotfiles]https://github.com/Eiziv/dotfiles, rewritten as a flake with
5Home Manager. Hyprland (Lua config) under uwsm, the greetd/gtkgreet login screen,
6the patched Waybar and the Eww control centre, the CachyOS kernel and the CachyOS
7system tweaks.
8
9Moving from CachyOS: see [MIGRATION.md]MIGRATION.md. The install wipes the
10NVMe drive and partitions it with [disko]https://github.com/nix-community/disko.
11
12## Layout
13
14```
15flake.nix inputs, the desktop system, the packages below
16hosts/desktop/ this machine: hostname, Home Manager
17 disko.nix the drive's partitions and btrfs subvolumes
18modules/nixos/
19 base.nix Nix, boot, locale, network, firewall, user
20 cachyos.nix CachyOS kernel + cachyos-settings, file by file
21 nvidia.nix RTX 3080 Ti, open kernel module
22 desktop.nix Hyprland, uwsm, greetd, audio, Bluetooth, fonts
23 gaming.nix Steam, proton-cachyos, gamemode, gamescope, ...
24 apps.nix desktop apps, Claude Cowork, OpenDeck udev, Bolt
25 vm.nix the test VM
26modules/home/
27 files.nix links config/ into ~/.config (was symlink.sh)
28 services.nix desktop background programs as systemd user services
29 shell.nix zsh (as cachyos-zsh-config), git, gh, ssh
30 theming.nix GTK, cursor
31 packages.nix tools the scripts call; imsh-clients, philly
32config/ the dotfiles themselves
33pkgs/ packages not in nixpkgs, or patched
34```
35
36## Everyday use
37
38```bash
39sudo nixos-rebuild switch --flake ~/git/dot # apply changes (alias: rebuild)
40nix flake update --flake ~/git/dot # newer packages; then rebuild (alias: update)
41```
42
43Every rebuild is a boot menu entry, so a bad one is undone by picking the one
44before it.
45
46**Editing configs.** `~/.config/hypr`, `waybar`, `kitty`, `dunst`, `fuzzel`, `nvim`,
47`qt6ct`, Kvantum, `kdeglobals`, the Philly theme, Firefox's `user.js` and
48`userChrome.css` and `~/.p10k.zsh` link straight to `config/` in this checkout,
49like the old `symlink.sh` did, so edits apply without a rebuild. (Set
50`dot.liveConfig = false` to have them copied into the Nix store instead.) If the
51checkout is not at `~/git/dot`, set `dot.repoPath`.
52
53Configs that programs write themselves (btop, micro, MangoHud/vkBasalt/vkSumi
54from GOverlay, `mimeapps.list`) are copied in only when missing and then left to
55the program.
56
57**Signal theme.** `config/signal/theme.css` is built into the Signal package
58(`pkgs/signal-desktop-themed`), so after editing it run `rebuild` and then
59`config/signal/restart`.
60
61## Background programs
62
63Everything Hyprland used to start from `hl.on("hyprland.start")` is a systemd
64user service now, started with `graphical-session.target` by uwsm and restarted
65if it crashes:
66
67| Service | |
68|---|---|
69| `waybar`, `hypridle`, `hyprpaper`, `dunst`, `hyprpolkitagent` | the shell |
70| `eww` | control centre and notification flyouts |
71| `blueman-applet`, `nm-applet`, `xembedsniproxy` | tray (after Waybar) |
72| `xwl-clipbridge` | X11 → Wayland clipboard for Wine/Proton games |
73| `autostart-apps` | opens Signal, Discord, Faugus, OpenDeck and WowUp, each as its own unit |
74
75```bash
76systemctl --user status waybar
77journalctl --user -u waybar -f
78systemctl --user restart waybar
79```
80
81`hyprland.lua` keeps only what has to live in the compositor: the startup window
82rules that place those apps and hide WowUp's window.
83
84## Gaming
85
86- Kernel: `linux-cachyos-latest-lto-zen4` from
87 [xddxdd/nix-cachyos-kernel]https://github.com/xddxdd/nix-cachyos-kernel, the
88 same build as CachyOS's znver4 `linux-cachyos` (EEVDF, 1000 Hz, ThinLTO, Zen 4).
89- cachyos-settings: sysctl, I/O schedulers, THP, ntsync, limits, oomd, PCI latency,
90 ananicy-cpp with CachyOS's rules, bpftune; see `modules/nixos/cachyos.nix`.
91- `proton-cachyos` is installed for Steam under CachyOS's own internal name
92 (`proton-cachyos-slr`), so Steam's existing choice of it still applies.
93 ProtonPlus-installed tools in `~/.steam` carry over as they are.
94- Launch options: `game-performance %command%`, `gamemoderun %command%`,
95 `dlss-swapper %command%`, `mangohud %command%`.
96
97Not ported: CachyOS builds *all* its packages for x86-64-v3/v4; NixOS uses
98generic x86-64 builds outside the kernel and Proton. The difference in games is
99small.
100
101## Testing in a VM
102
103```bash
104./vm.sh
105```
106
107Boots this exact system in QEMU, without NVIDIA and with the configs copied in.
108You land on the desktop; log out (Super+Delete) to see the login screen.
109
110## Custom packages
111
112| | |
113|---|---|
114| `waybar` | nixpkgs' Waybar with the three patches from the old PKGBUILD |
115| `xembedsniproxy` | standalone build from plasma-workspace 6.7.5, three patches |
116| `signal-desktop-themed` | Signal with `config/signal/theme.css` and a transparent window |
117| `claude-desktop` | Anthropic's official Linux .deb, repackaged |
118| `opendeck` | upstream release .deb, repackaged |
119| `breezex-cursor` | BreezeX-Black cursor theme |
120| `proton-cachyos` | CachyOS's Proton release, for Steam |
121| `python3-desktop` | Python with PyGObject and python-xlib for the scripts |
122
123Each builds on its own, e.g. `nix build .#waybar`. The `.deb`-based ones and
124proton-cachyos say at the top of their file how to update them.