Modules
Every cattery module declares its options under cattery.<category>.<path> and is off
until something enables it, either you or a room. The option path follows the
directory: modules/nixos/services/nginx/default.nix declares cattery.services.nginx.
Exports
The module outputs are flat. purr exports one attribute per top-level directory of a
module tree, so nixosModules.services holds every NixOS service module and there is no
nixosModules.services.nginx.
| Output | Source directories | Categories |
|---|---|---|
nixosModules | modules/nixos, modules/shared | apps, cli-apps, containers, desktop, home, nix, room, secrets, security, services, system, user |
darwinModules | modules/darwin, modules/shared | apps, brew, cli-apps, home, nix, room, secrets, services, system, user |
homeModules | modules/home | apps, cli-apps, desktop, room, secrets, services, system, user |
The three outputs share their category names. home and nix come from
modules/shared, containers and security exist only on NixOS, and brew only on
nix-darwin. Each output also has default, which imports every category plus the
third-party modules from extraModules in cattery's flake.nix.
Exported modules have stable keys, so you can remove a whole category from the bundle:
{ inputs, ... }:
{
imports = [ inputs.cattery-modules.nixosModules.default ];
disabledModules = [ inputs.cattery-modules.nixosModules.containers ];
}Conventions
Plain definitions win
Rooms set enable with lib.mkDefault. Any value you set yourself takes precedence, so
you can turn a room member off or swap it for another module:
{
cattery = {
room.desktop.dev.enable = true;
apps.zed-editor.enable = false;
cli-apps.editor.helix.enable = true;
};
}extraOptions
Modules that wrap an upstream program or service have an extraOptions option. It is
merged into the upstream option with lib.mkMerge, so it takes anything the upstream
module takes, including lib.mkForce and lib.mkIf:
{
# Merged into programs.git.
cattery.cli-apps.dev-kit.git.extraOptions = {
lfs.enable = true;
maintenance.enable = true;
};
# Merged into services.openssh.
cattery.services.openssh.extraOptions = {
settings.PasswordAuthentication = false;
};
}Each extraOptions description names the option it merges into, for example
"Additional options merged into services.openssh."
persistence
Modules that keep state have a persistence option that defaults to true. When
impermanence is enabled, the module adds its state paths to
cattery.system.impermanence. Set it to false to let that state reset on boot:
{
cattery.cli-apps.shell.atuin = {
enable = true;
persistence = false;
};
}Platform guards
homeModules.default works on Linux and macOS. A Home Manager module that only makes
sense on one platform still declares its options everywhere and guards its config:
# modules/home/apps/iina/default.nix
{ config, pkgs, lib, namespace, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
cfg = config.${namespace}.apps.iina;
in
{
options.${namespace}.apps.iina = {
enable = lib.mkEnableOption "the IINA media player";
};
config = lib.mkIf (cfg.enable && isDarwin) {
home.packages = [ pkgs.iina ];
};
}Setting a Darwin-only option on Linux is therefore harmless, which is what lets rooms
list both kinds of members. The modules shared by NixOS and nix-darwin read
purr.meta.isLinux and purr.meta.isDarwin instead.
Shared modules
modules/shared is imported by both NixOS and nix-darwin.
| Option | What it does |
|---|---|
cattery.user | The primary user: name, realName, email, gpg, authorizedKeys, defaultUserShell, and useSecretPasswordFile. Creates the user on both platforms and sets system.primaryUser on macOS |
cattery.home.extraOptions | Home Manager configuration forwarded to home-manager.users.<cattery.user.name> with mkAliasDefinitions. Hosts without Home Manager still evaluate |
cattery.nix | Flakes, automatic garbage collection, store optimisation, and the beans registry entry (nix.registry.beans.to) for develop-templates |
cattery.secrets | agenix secrets. See Secrets |
cattery.system.fonts, cattery.system.ulimit | Default fonts and the open files limit |
cattery.cli-apps.openssh | The OpenSSH client |
cattery.cli-apps.security | fido2, gnupg (the agent), and yubihsm |
cattery.cli-apps.shell | fish and zsh as login shells |
cattery.services.wg-quick | WireGuard interfaces from config files in /etc/wireguard |
cattery.services.sing-box | sing-box, configured through settings or a secret config file |
cattery.apps.winbox | WinBox for MikroTik routers |
NixOS modules
| Category | Modules |
|---|---|
apps | game.steam, game.gale, vmware, yubikey |
cli-apps | mtr, nix.nix-ld, ssh (global known hosts) |
containers | NixOS containers, see below |
desktop | plasma, gnome, hyprland with the caelestia and charm-cat themes, niri, lightdm, and addons.catppuccin, addons.chromium-support, addons.xdg-portal |
security | security.pam, assigned to the NixOS security.pam options |
services: network | openssh, tailscale, cloudflared, adguardhome, smartdns, avahi, nginx, acme |
services: storage | samba, samba-wsdd, nfs, target, sanoid, syncoid |
services: apps | forgejo, forgejo-runner, gitea, gitea-actions-runner, vaultwarden, postgresql, hydra, hydra-builder |
services: containers and VMs | docker, containerd, k3s, kubernetes, firecracker, flintlock, qemu-guest, cloud-init |
services: other | beszel, netdata, cron, getty, vscode-server |
system: boot | boot.efi, boot.grub, boot.lanzaboote (Secure Boot), boot.kernel, boot.binfmt |
system: file systems | fileSystems.zfs, fileSystems.nfs, fileSystems.samba, fileSystems.webdav, fileSystems.btrfs.impermanence |
system: other | network (with wireless, bridges, nat), impermanence, locale, time, fcitx5, peripherals, automount, gpu.amd, wsl, proxmox.lxc |
Home Manager modules
| Category | Modules |
|---|---|
apps | Editors (vscode, zed-editor, code-cursor, antigravity-ide, jetbrains), terminals (wezterm, ghostty, foot), and desktop apps such as browser, instant-messengers, thunderbird, slack, zoom-us, graphics, video, iina, game, hmcl, remote, safety |
cli-apps.dev-kit | git, jujutsu, nix, cpp, go, java, javascript, lua, rust, wasm, dive |
cli-apps.shell | fish, zsh, nushell, powershell, starship, atuin, direnv |
cli-apps.editor | helix, neovim, vim |
cli-apps.tool | Everyday tools (useful, http-utils, network, monitoring, compressor, tldr), AI coding tools (claude-code, codex, opencode, pi, goose, kimi-code, qwen-code, cursor-cli, github-copilot-cli, antigravity-cli, ollama), and others such as gh, tea, acme-sh, installer, ventoy |
cli-apps.operations | cloud with one module per provider, kubernetes, serverless |
cli-apps: other | ssh, security.gnupg, security.yubihsm, nix.home-manager, nix.nix-index, file-manager.yazi, database.sqlite, video.visual, video.youtube, cloudflared, warp, android, disk, misc |
desktop | hyprland with its addons and the caelestia and charm-cat themes, niri, plasma, xdg, addons.catppuccin |
services | gpg-agent, awww (wallpaper daemon) |
system | fonts, impermanence |
user, secrets | The Home Manager side of cattery.user and cattery.secrets |
Containers
cattery.containers.<name> declares a NixOS container managed with machinectl:
{
cattery.containers.web = {
networkMode = "none";
forwardPorts = [
{
protocol = "tcp";
hostPort = 8080;
containerPort = 80;
}
];
# system.stateVersion defaults to the host value.
config.cattery.services.nginx.enable = true;
};
}hostModules.enabledefaults totrue. The container then importshostModules.modules, which defaults to[ inputs.cattery-modules.nixosModules.default ], and listsnixosModules.containersin itsdisabledModules, so containers cannot nest. SethostModules.enable = falsefor a container without cattery.networkModeisnone(a private veth pair with generated addresses),bridge(needshostBridge), orhost(the host network namespace).hostModules.autoLoaderturns on services inside the container when the container's name matches one:postgresql,vaultwarden,nginx, andacmefrom NixOS, andwg-quick,sing-box, andopensshfrom the shared modules. A container namedpostgresqlrunscattery.services.postgresql. SetbindSecretsEtc = trueto bind mount those services' decrypted/etcsecret files into the container.modules,specialArgs,bindMounts,dns, andextraOptions(merged intocontainers.<name>) cover the rest.
nix-darwin and Mac mini
cattery.system.power
Wraps the nix-darwin power options. Each value defaults to null, which leaves the
macOS setting unchanged, and only set values are passed on. room.server uses it to keep
a headless Mac running:
{
cattery.system.power = {
enable = true;
restartAfterPowerFailure = true;
restartAfterFreeze = true;
sleep = {
computer = "never";
harddisk = "never";
display = 10;
allowSleepByPowerButton = false;
};
};
}The sleep values take minutes or "never". extraOptions is merged into power.
cattery.system.sudoTouch
Touch ID for sudo through security.pam.services.sudo_local. Every value is set with
mkDefault, so direct sudo_local settings still win.
| Option | Default | Effect |
|---|---|---|
enable | false | Sets touchIdAuth |
reattach | false | Reattaches sudo to the user session so Touch ID works inside tmux and screen |
watchIdAuth | false | Lets an Apple Watch approve sudo |
cattery.brew
Homebrew through nix-darwin's homebrew module. It also adds /opt/homebrew/bin to the
system path.
{
cattery.brew = {
enable = true;
taps = [ "apple/apple" ];
brews = [ "mas" ];
casks = [ "raycast" ];
masApps = {
Xcode = 497799835;
};
# "none", "check", "uninstall", or "zap". Sets homebrew.onActivation.cleanup.
cleanup = "zap";
};
}onActivation.autoUpdate and onActivation.upgrade default to true. extraOptions is
merged into homebrew.
cattery.services.wg-quick and cattery.services.sing-box
Both modules are shared, so the same configuration works on NixOS and macOS:
{
# Brings up /etc/wireguard/wg0.conf.
cattery.services.wg-quick.configNames = [ "wg0" ];
cattery.services.sing-box = {
enable = true;
settings.log.level = "warn";
};
}On NixOS they use networking.wg-quick.interfaces and the NixOS services.sing-box
module. On macOS each one runs as a launchd daemon that waits for the Nix store volume
before it starts and logs to /var/log/wg-quick-<name>.log or /var/log/sing-box.log.
macOS has no kernel WireGuard, so wg-quick uses wireguard-go there.
wg-quick.enable defaults to true as soon as configNames is not empty. The
configuration files usually come from secrets. On Linux,
sing-box settings can reference secret files with _secret. macOS writes the settings
to the Nix store, so _secret is rejected there. Put the whole config in the sing-box
secret file instead.
cattery.services.openssh turns on the OpenSSH server on macOS, and cattery.system.useful
applies Finder and other macOS defaults, such as showing all file extensions and not
writing .DS_Store files on network and USB volumes.