Imported from shikanime-labs/knix (
AGENTS.md). Install upstream withnpx skills add shikanime-labs/knix. Copyright stays with the author.
AGENTS.md
Commit conventions
- Plain English, capitalized titles
- No conventional commit prefixes (no
feat:,fix:,chore:) - No trailing periods
- GPG sign all commits
Code style
- Nix: 2-space indentation,
with lib;at the top of each file - Nix: dotted assignment (
a.b.c = v;) for a single leaf under a shared parent key; a record literal once two or more keys share the parent, keys sorted - Options: use
mkEnableOptionfor feature flags,mkOptionwith proper types - Submodules: group related options under named submodules (e.g.,
kernel) - Defaults: provide opinionated defaults that match the Shikanime RKE2 deployment
Module design
- All options under
services.knix.* - Keep a thin
modules/default.nixaggregator that imports the submodules - Keep root options in
modules/knix.nix - Keep RKE2 deployment config in
modules/rke2.nix - Keep each concern in its own file under
modules/ - Follow the Catppuccin pattern:
nixosModules.default = import ./modules
Stack Workflow
- Install the official GitHub extension once:
gh extension install github/gh-stack(requires GitHub CLI ≥ 2.0;gh stackis in public preview and may change). - Keep one logical change per PR; split large work into a stack of PRs.
- Create a stack:
gh stack init, thengh stack addfor each new branch, and commit on the active branch.gh stack viewlists the stack. - Submit/update:
gh stack submit(add--opento open PRs,--autoto skip prompts). Resubmit after each change to refresh titles, bodies, and branches. - Pull down an existing stack:
gh stack checkout <PR_NUMBER>(also accepts a stack number, PR URL, or branch name). - Rebase onto updated trunk:
gh stack rebase(cascading), thengh stack submit. - Land a stack:
gh stack merge(interactive) orgh stack merge <PR_NUMBER> --yes --squashto merge up to a PR. - Never
gh pr mergeon a stacked PR — onlygh stack mergelands stacks. - Never force-push stack branches;
gh stackowns the branch pointers.
Environment
This repository ships a .envrc for direnv. Run direnv allow once after
cloning; direnv then loads the Nix flake dev shell automatically on every
directory change (.envrc runs
use flake . --accept-flake-config --no-pure-eval). Without direnv, enter
the same shell manually with nix develop.