dot

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

122 lines5233 bytesMarkdown

dot

NixOS configuration for desktop: the CachyOS setup from Eiziv/dotfiles, rewritten as a flake with Home Manager. Hyprland (Lua config) under uwsm, the greetd/gtkgreet login screen, the patched Waybar and the Eww control centre, the CachyOS kernel and the CachyOS system tweaks.

Moving from CachyOS: see MIGRATION.md.

Layout

flake.nix                  inputs, the desktop system, the packages below
hosts/desktop/             this machine: hostname, disks, Home Manager
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, greetd, audio, Bluetooth, fonts
  gaming.nix               Steam, proton-cachyos, gamemode, gamescope, ...
  apps.nix                 desktop apps, Claude Cowork, OpenDeck udev, Bolt
  vm.nix                   the test VM
modules/home/
  files.nix                links 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
  packages.nix             tools the scripts call; imsh-clients, philly
config/                    the dotfiles themselves
pkgs/                      packages not in nixpkgs, or patched

Everyday use

sudo nixos-rebuild switch --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. ~/.config/hypr, waybar, kitty, dunst, fuzzel, nvim, qt6ct, Kvantum, kdeglobals, the Philly theme, Firefox's user.js and userChrome.css and ~/.p10k.zsh link straight to config/ in this checkout, like the old symlink.sh did, so edits apply without a rebuild. (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 from GOverlay, 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

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

Gaming

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.

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.