Development — Languages, Editors and Version Control
Purpose
The purpose.development Home-Manager modules describe language support once and render it into every enabled editor.
Adding a language should not require editing Zed, VSCode, Helix, and OpenCode separately.
The same purpose owns version control, so git and Jujutsu share one user identity and one signing key.
Entry Point
- Language modules:
modules/home-manager/purpose/development/languages - Factories and helpers:
mkLanguage.nix,lib.nix - Editor modules:
modules/home-manager/purpose/development/editors
Architecture / Services / Scope
Language modules
Each language is a module created by mkLanguage.nix.
A module exposes:
enable— toggle support for the language.treesitterPackages— grammars, with an automatictree-sitter-grammars.tree-sitter-<name>default.extraPackages— tools that are not LSP servers or formatters.lsp— LSP server descriptors.formatters— formatter descriptors.editors— language-level editor metadata such as extension names and language identifiers.allPackages— read-only union of every package the language contributes.
languages.common is enabled by default and owns the shared servers and formatters for config formats, markup, shell,
containers, SQL, and infrastructure files (Markdown, JSON, YAML, TOML, CSS, HTML, XML, Dockerfile, Docker Compose, Bash, Terraform, SQL, and spelling).
Descriptors
Every descriptor is self-describing, so editors never hard-code language knowledge:
{
name = "nixd"; # editor-facing server identifier
package = pkgs.nixd; # package placed on PATH
binary = "nixd"; # optional binary name when it differs from `name`
args = [ ]; # launch arguments
filetypes = [ ".nix" ]; # extensions/globs
languages = [ "nix" ]; # canonical language ids
initializationOptions = { };
settings = { };
env = { };
editors = { }; # per-editor overrides, keyed by editor name
providesFormatting = false; # server also formats; see below
}
Servers that format
An LSP descriptor may set providesFormatting = true to declare that the server formats the language.
Renderers that support language-server formatting then use that server instead of an external formatter descriptor:
- Zed emits
formatter = { language_server = { name = <server>; }; }. - Helix sets
auto-format = trueand omitsformatter, so Helix formats with the server. - OpenCode has no language-server formatting and keeps using the external formatter descriptor.
This keeps formatting aligned with the server’s own project knowledge, such as the crate edition rust-analyzer passes to rustfmt.
A language therefore keeps its external formatter descriptor for editors that cannot format through a server.
Capability is always declared explicitly; never inferred from a server’s presence, because many servers (pyright, marksman, autocorrect) do not format.
Servers that currently opt in: rust-analyzer, clangd, gopls, nil, taplo, yaml-language-server, and bash-language-server.
Each of these formats with the same engine as the language’s external formatter,
so opting in does not change formatting output, except bash-language-server, which passes editor indent and .editorconfig to shfmt.
Editor renderers
Renderers live beside the editor they serve and flatten descriptors across every enabled language:
editors/zed/render.nix—lspsettings,languages.*.language_servers, per-language formatters, extensions, and wrapper packages.editors/helix/render.nix—languages.tomllanguage-server,language, and formatter entries.editors/vscode/render.nix— extension lists and settings grouped by profile.editors/ai/render.nix— OpenCodelspandformattersections.
The editors.<name> field on a descriptor is the escape hatch for editor quirks (custom commands, formatter flags, language identifiers).
Language names are otherwise derived from the canonical id
via languages/names.nix,
so modules only declare languages = [ "csharp" ], never "C#" and "c-sharp" separately.
Editors
- Zed —
purpose.development.editors.zed. - Helix —
purpose.development.editors.helix. - VSCode —
purpose.development.editors.vscode. - OpenCode —
purpose.development.editors.ai.
Version control
purpose.development.vcs configures git and Jujutsu from the user identity declared once, and signs commits with core.profile.identity.publicKey.
- Entry point:
modules/home-manager/purpose/development/vcs.nix - Enabled by default:
purpose.development.vcs.enabledefaults topurpose.development.enable; set it to false to keep the language tooling without version control. user.emailis required: it has no default, and evaluation fails while the module is enabled without it.user.namedefaults to the Home-Manager username with the first letter capitalised.user.publicKeydefaults to the contents ofcore.profile.identity.publicKey; when that file is missing the option staysnulland signing is skipped instead of failing the build.primaryVCSselects the installed tool set:jujutsu(the default) addsjjui,jj-pre-push,watchmanand usesmeldas the diff and merge editor, whilegitaddsgitui. Both variants installgh,gh-dashanddelta.- Signing — when a key is available, git signs by default with the SSH key and verifies against a generated allowed-signers file; Jujutsu signs at push time only (
git.sign-on-push) with the same key and the same allowed-signers file. enableJJDescWrapperinstalls ajj-descwrapper usingai.aliases.singleTurn.jj-descis a single-turn, non-agentic LLM consumer: one request, no repeated turns over generated output. Its API-key secret is declared from the provider registry.
Options
Version control
purpose.development.vcs.enable
| Type | boolean |
| Default | config.purpose.development.enable |
| Example | true |
Whether to enable vcs.
purpose.development.vcs.enableJJDescWrapper
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable jj-desc wrapper.
purpose.development.vcs.primaryVCS
| Type | one of "git", "jujutsu" |
| Default | "jujutsu" |
The primary version control system to use, this changes the program set that gets installed and configured.
purpose.development.vcs.user.email
| Type | null or string |
| Default | null |
The email to use for version control operations, this is your commit email.
If this is left empty while this module is enabled, you will receive an eval error.
purpose.development.vcs.user.name
| Type | string |
| Default | "home-manager username with capitalisation for the first character" |
The name to use for version control operations, this is your commit display name.
purpose.development.vcs.user.publicKey
| Type | null or string |
| Default | builtins.readFile "${config.core.profile.identity.publicKey}" |
The SSH key to use for signing commits.
Zed
purpose.development.editors.zed.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Zed editor.
purpose.development.editors.zed.extensions
| Type | list of string |
| Default | [ "autocorrect" "catppuccin-icons" "docker-compose" "dockerfile" "editorconfig" "git-firefly" "ini" "log" "nu" "qml" "terraform" "tokyo-night" "toml" "typos" ] |
Zed extensions to install. Language modules contribute their own extensions automatically.
purpose.development.editors.zed.extraPackages
| Type | list of package |
| Default | [ <derivation autocorrect-2.16.3> <derivation docker-compose-language-service-0.2.0> <derivation dockerfile-language-server-0.15.0> <derivation shellcheck-0.11.0> <derivation shfmt-3.14.1> <derivation libz-1.2.8.2025.03.07> ] |
Packages made available to Zed’s wrapper PATH. Language modules contribute their own packages automatically.
purpose.development.editors.zed.installRemoteServer
| Type | boolean |
| Default | true |
Install the Zed remote server binary so this machine can be a remote target.
purpose.development.editors.zed.userSettings
| Type | attribute set |
| Default | { } |
Settings merged recursively over the module defaults. User values take precedence.
Helix
purpose.development.editors.helix.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Helix Editor.
VSCode
purpose.development.editors.vscode.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Enable VSCode.
OpenCode
purpose.development.editors.ai.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Enable AI Tools & Assistants.
purpose.development.editors.ai.includeDefaults
| Type | boolean |
| Default | true |
Whether to include the default set of agents and skills provided by this module.
This includes the agents and skills defined in the ./agents and ./skills directories of this module.
Disabling this will result in a minimal setup with only the base configuration for OpenCode and no pre-registered agents or skills.
purpose.development.editors.ai.skills
| Type | list of string |
| Default | [ ] |
| Example | '' [ ''${inputs.my-skill-repo}/skills/my-skill ''${self}/skills/another-skill ] '' |
List of additional AI skills to add to the global registry. These should be paths to a skill directory, this could be through a flake input or a path in the flake.
These skills will be installed to ~/.agents/skills and will be available to all agents that support the skill system, such as Claude and OpenCode.
purpose.development.editors.ai.tabby.enable
| Type | boolean |
| Default | false |
| Example | true |
Whether to enable Tabby agent for tab completion.
Operational Notes / Assumptions
- Binaries resolve from
PATHby default. Hard-codingbinary.pathin Zed bypasses direnv; descriptors therefore add packages to the editor environment instead of pinning store paths. - Launch arguments are shared across editors.
Use
editors.<name>when an editor needs different flags, for example formatter write flags in OpenCode. - A server marked
providesFormattingtakes precedence over external formatter descriptors in Zed and Helix. Keep the external formatter declared for OpenCode. - Zed settings merge recursively.
userSettingsvalues take precedence over the module defaults. languages.commonis enabled withpurpose.development.enable; disable it explicitly when a host should not receive the shared config-format tooling.