nix-patterns
Standardized NixOS module patterns for system configuration, package management, and home-manager setups.
Introduction
This skill provides a curated set of architectural patterns and best practices for managing NixOS and home-manager configurations. It is designed for developers, system administrators, and DevOps engineers who use Nix to maintain reproducible environments. By implementing these patterns, users can ensure their system configurations remain modular, maintainable, and scalable across different machines and user profiles. The skill guides you through the process of structuring your Nix files to separate system-level services from user-specific dotfiles and application packages.
-
Standardized directory structure for organizing home-manager modules and NixOS system modules.
-
Patterns for conditional package installation using lib.optionals based on system architecture.
-
Implementation examples for XDG configuration files and complex Nix attribute sets.
-
Structured import strategies to keep your main configuration files clean and declarative.
-
Best practices for machine-specific host configurations.
-
To use this skill, ensure your project follows the suggested directory hierarchy: modules/home for user configurations and modules/nixos for system services.
-
When adding packages, use the provided boilerplate to handle platform-specific dependencies like x86_64-linux vs. ARM systems.
-
The skill assumes familiarity with the Nix expression language; use the module patterns when extending your nixpkgs configurations.
-
Inputs typically involve adding paths to your home/default.nix imports and defining package lists within module attributes.
-
Outputs result in a robust, version-controlled system configuration that can be rebuilt using standard Nix commands.
-
Note that this is a structural template; always ensure your local Nix flake or system configuration files are correctly linked in your flake.nix or configuration.nix files to take effect.
Repository Stats
- Stars
- 263
- Forks
- 23
- Open Issues
- 7
- Language
- Python
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 1, 2026, 07:30 AM