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