dot

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

3664507Drop the CachyOS kernel's binary cache
Gustaf Granström
config/Hide WowUp's login window again
hosts/Static 10.0.0.40 on eno1 through systemd-networkd
modules/Drop the CachyOS kernel's binary cache
pkgs/OpenDeck plugins: Node.js on its PATH, nix-ld for prebuilt binaries
tools/Control centre: Network and Bluetooth tiles, Update NixOS
.gitignoreNixOS flake for the desktop, ported from the CachyOS dotfiles
backup-filterInstall with disko on a wiped drive
flake.lockSignal 8.31.0 from nixpkgs master
flake.nixDrop the CachyOS kernel's binary cache
logo.svgNixOS flake for the desktop, ported from the CachyOS dotfiles
MIGRATION.mdDrop greetd: autologin on tty1, start the session behind hyprlock
README.mdDrop greetd: autologin on tty1, start the session behind hyprlock
restore-filterRestore the wallpaper folder; match NixOS's tray IDs
vm.shNixOS flake for the desktop, ported from the CachyOS dotfiles

README.md

dot

NixOS configuration for desktop: the CachyOS setup from Eiziv/dotfiles, rewritten as a flake with Home Manager. Hyprland (Lua config) under uwsm, logged in automatically and started behind hyprlock, the patched Waybar and the Eww control centre, the CachyOS kernel and the CachyOS system tweaks.

Moving from CachyOS: see MIGRATION.md. The install wipes the NVMe drive and partitions it with disko.

Layout

flake.nix                  inputs, the desktop system, the packages below
hosts/desktop/             this machine: hostname, Home Manager
  disko.nix                the drive's partitions and btrfs subvolumes
modules/nixos/
  base.nix                 Nix, boot, locale, network, firewall, user
  cachyos.nix              CachyOS kernel + cachyos-settings, file by file
  nvidia.nix               RTX 3080 Ti, open kernel module
  desktop.nix              Hyprland, uwsm, autologin, audio, Bluetooth, fonts
  gaming.nix               Steam, proton-cachyos, gamemode, gamescope, ...
  apps.nix                 desktop apps, Claude Cowork, OpenDeck udev, Flatpak
  vm.nix                   the test VM
modules/home/
  desktop.nix              Hyprland, hyprlock, hypridle, hyprpaper, Waybar, dunst
  apps.nix                 kitty, fuzzel, neovim, Firefox
  files.nix                links the rest of config/ into ~/.config (was symlink.sh)
  services.nix             desktop background programs as systemd user services
  shell.nix                zsh (as cachyos-zsh-config), git, gh, ssh
  theming.nix              GTK, cursor, Qt (qt6ct, Kvantum, kdeglobals)
  packages.nix             tools the scripts call; imsh-clients, philly
config/                    the dotfiles themselves
pkgs/                      packages not in nixpkgs, or patched
tools/bench-compare        compares MangoHud logs from CachyOS and NixOS

Everyday use

nixos-rebuild switch --sudo --flake ~/git/dot   # apply changes (alias: rebuild)
nix flake update --flake ~/git/dot              # newer packages; then rebuild (alias: update)

Every rebuild is a boot menu entry, so a bad one is undone by picking the one before it.

Editing configs. Apps with a Home Manager module are set in Nix, in modules/home/desktop.nix, apps.nix and theming.nix: Hyprland, hyprlock, hypridle, hyprpaper, Waybar, dunst, kitty, fuzzel, Firefox's prefs, qt6ct, Kvantum and kdeglobals. Paths in them (wallpaper, icons, scripts, the terminal) come from Nix, so change these there and rebuild.

What has no module, or is code rather than settings, stays in config/ and is linked straight to this checkout, like the old symlink.sh did, so edits apply without a rebuild: Hyprland's startup rules (hypr/startup.lua), the scripts under hypr/scripts and waybar/scripts, the Eww flyouts (waybar/eww), fuzzel's launcher and favourites, nvim's init.lua, Firefox's userChrome.css, the Kvantum themes, the Philly theme and ~/.p10k.zsh. (Set dot.liveConfig = false to have them copied into the Nix store instead.) If the checkout is not at ~/git/dot, set dot.repoPath.

Configs that programs write themselves (btop, micro, MangoHud/vkBasalt/vkSumi, mimeapps.list) are copied in only when missing and then left to the program.

Signal theme. config/signal/theme.css is built into the Signal package (pkgs/signal-desktop-themed), so after editing it run rebuild and then config/signal/restart.

Background programs

Everything Hyprland used to start from hl.on("hyprland.start") is a systemd user service now, started with graphical-session.target by uwsm and restarted if it crashes:

Service
waybar, hypridle, hyprpaper, dunst, hyprpolkitagentthe shell
ewwcontrol centre and notification flyouts
blueman-applet, nm-applet, xembedsniproxytray (after Waybar)
xwl-clipbridgeX11 → Wayland clipboard for Wine/Proton games
autostart-appsopens Signal, Discord, Faugus, OpenDeck and WowUp, each as its own unit
systemctl --user status waybar
journalctl --user -u waybar -f
systemctl --user restart waybar

config/hypr/startup.lua keeps only what has to live in the compositor: the startup window rules that place those apps and hide WowUp's window.

Gaming

  • Kernel: linux-cachyos-latest-lto-zen4 from xddxdd/nix-cachyos-kernel, the same build as CachyOS's znver4 linux-cachyos (EEVDF, 1000 Hz, ThinLTO, Zen 4).
  • cachyos-settings: sysctl, I/O schedulers, THP, ntsync, limits, oomd, PCI latency, ananicy-cpp with CachyOS's rules, bpftune; see modules/nixos/cachyos.nix.
  • proton-cachyos is installed for Steam under CachyOS's own internal name (proton-cachyos-slr), so Steam's existing choice of it still applies. ProtonPlus-installed tools in ~/.steam carry over as they are.
  • Launch options: game-performance %command%, gamemoderun %command%, dlss-swapper %command%, mangohud %command%.

Not ported: CachyOS builds all its packages for x86-64-v3/v4; NixOS uses generic x86-64 builds outside the kernel and Proton. The difference in games is small.

nix develop opens a shell with nixos-anywhere and nixfmt, on this machine or the Mac.

Testing in a VM

./vm.sh

Boots this exact system in QEMU, without NVIDIA and with the configs copied in. You land on the desktop; log out (Super+Delete) to see the login screen.

Custom packages

waybarnixpkgs' Waybar with the three patches from the old PKGBUILD
xembedsniproxystandalone build from plasma-workspace 6.7.5, three patches
signal-desktop-themedSignal with config/signal/theme.css and a transparent window
claude-desktopAnthropic's official Linux .deb, repackaged
opendeckupstream release .deb, repackaged
breezex-cursorBreezeX-Black cursor theme
proton-cachyosCachyOS's Proton release, for Steam
python3-desktopPython with PyGObject and python-xlib for the scripts

Each builds on its own, e.g. nix build .#waybar. The .deb-based ones and proton-cachyos say at the top of their file how to update them.