nix-naming

Enforce camelCase, kebab-case, and UPPER_CASE naming in Nix code.

340|18|Updated May 11, 2023
One-click install
npx skills add https://github.com/khaneliman/khanelinix --skill nix-naming
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nix-naming
Source: https://github.com/khaneliman/khanelinix/tree/main/modules/common/ai-tools/skills/naming
Command: npx skills add https://github.com/khaneliman/khanelinix --skill nix-naming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In Nix projects, inconsistent naming makes code hard to read, maintain, and collaborate on.

Core Features & Use Cases

  • CamelCase for variables or attributes within expressions
  • kebab-case for filenames and directories
  • UPPER_CASE for constants and cfg patterns
  • Clear guidance on the cfg pattern to keep namespaces predictable

Quick Start

Apply the naming conventions to a sample Nix module to enforce camelCase for variables, kebab-case for files, and UPPER_CASE for constants.

Frequently Asked Questions about nix-naming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent naming conventions in Nix modules?▼

To enforce consistent naming in Nix modules, apply specific style rules: camelCase for variables, kebab-case for filenames, and UPPER_CASE for constants. This reduces confusion and errors by validating code with a linter-like process to catch deviations.

What is the best way to name NixOS configuration files and variables?▼

The best way to name NixOS configuration files and variables is to use kebab-case for files and directories, camelCase for variables, and UPPER_CASE for constants. This ensures code remains maintainable and collaboration-friendly.

When do I need UPPER_CASE in Nix expressions?▼

You need UPPER_CASE in Nix expressions specifically for constants and cfg patterns. Maintaining this predictable namespace pattern alongside camelCase variables and kebab-case files ensures clear configuration management across modules.

Does this naming convention linter validate Nix scripts automatically?▼

Yes, the naming convention linter validates Nix scripts automatically by applying a linter-like process to catch deviations from the specified style rules. It checks variables, files, and attributes to prevent inconsistent naming.

Why does inconsistent Nix code make maintenance harder?▼

Inconsistent Nix code makes maintenance harder because mixed camelCase, kebab-case, and UPPER_CASE patterns reduce readability and create unpredictable namespaces. Enforcing specific style rules for variables, files, and constants solves this by catching deviations early.