Skip to content
Prompt

nix — Windsurf Rules

by fred-drake

AI Summary

A Windsurf-specific prompt that establishes best practices for Nix flake configuration, code modularity, and documentation standards. Developers using Windsurf for NixOS home configuration benefit from these structured guidelines.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "nix — Windsurf Rules" prompt rules to my project.
Repository: https://github.com/fred-drake/nix

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Nix flake for home configuration

🔄 Project Awareness & Context

• Always read PLANNING.md at the start of a new conversation to understand the project's architecture, goals, style, and constraints. • Use consistent naming conventions, file structure, and architecture patterns as described in PLANNING.md.

🧱 Code Structure & Modularity

• Never create a file longer than 500 lines of code. If a file approaches this limit, refactor by splitting it into modules or helper files. • Organize code into clearly separated modules, grouped by feature or responsibility. • Use clear, consistent imports (prefer relative imports within packages). • Modularity: Break down configurations into reusable modules • DRY (Don't Repeat Yourself): Extract common patterns into functions or modules • Naming Conventions: Use descriptive, consistent names for modules and variables

Nix Best Practices

• Package References: • Use outPath when creating symlinks to package locations • Prefer mkOutOfStoreSymlink for package paths • VS Code Extensions: • Path: ${config.home.path}/share/vscode/extensions • Configuration: • Enable in programs.vscode • Configure extensions using the extensions attribute

Module Structure

`nix { # Function arguments config, lib, pkgs, ... }: with lib; { # Module implementation options = { # Define your module options here }; config = mkIf config.yourmodule.enable { # Configuration implementation }; } `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
17 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars17
Forks2
Issues0
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more