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