Development
Prerequisites
Enter the dev shell for the formatters and linters:
bash
nix developIt provides nixfmt, statix and deadnix.
Formatting
bash
nixfmt flake.nix modules/**/*.nix pkgs/**/*.nixAdd a custom theme
- Create
dotfiles/themes/<Name>/theme.conf(copyTokyo-Nightas a base). - Drop a wallpaper next to it.
- Rebuild (
upd), then pick it fromALT + S → Custom.
Only name, background and foreground are required; everything else falls back to the monochrome palette. See Themes and dotfiles/themes/README.md.
Add a package
- One-off packages:
pkgs/custom.nix. - Permanent tooling: the matching file in
pkgs/categories/. - A whole new category: add a
pkgs/categories/<name>.nixand reference it inpkgs/categories.nix; thepwnbox.packages.toolset.<name>option is created automatically.
Add a bar style
- Create
dotfiles/config/quickshell/BarStyle<NN>.qml(copy an existing one). - Add its geometry to
dotfiles/config/quickshell/BarStyles.js. This is the single source of truth the bar and the calendar both read it. - Add an entry to
bar_stylesindotfiles/scripts/pwnbox-theme:"<id>|<Label>". - Add a preview
dotfiles/config/quickshell/previews/<id>.png. - Rebuild, then choose it from
ALT + S → Style.
Keep the height, exclusive, top/bottom and clock fields accurate so the calendar and exclusive zone stay correct.
Add a font
- Add the package to
modules/nixos/desktop/fonts.nix. - Add its family name to
font_choicesindotfiles/scripts/pwnbox-theme. - If it should be the default, also update the
nameddefaults infontconfig.defaultFontsandmodules/home/gtk.nix.
Add live theming for an app
Live updates work best when the app watches a file we can rewrite. The pattern used by Spotify, Equibop and Telegram is:
- Keep a managed base config in the flake.
- Generate the app's real config from the palette (and fonts) at runtime.
- Detect the current theme change from
pwnbox-theme'sapply_borders(which is called on every switch). - If the app supports file watching, rewrite the file in place; otherwise push the change however the app supports it.
Add the app to docs/apps.md when you do.
Testing
- Syntax-check the shell helpers:
bash -n dotfiles/scripts/pwnbox-theme - Parse the Nix modules:
nix-instantiate --parse modules/home/dotfiles.nix - Build without activating:
./install.sh build - Try it for one boot:
./install.sh test
Style guidelines
- Keep generated files out of the flake; only bases live there.
- Prefer
runandentryAfterin activation scripts so changes are idempotent. - When hiding UI (scrollbars, upsells), match by stable attribute/substring and keep the rule defensive so a client update cannot break layout.