nix-conditionals

Community

Master Nix conditionals with lib patterns.

Authorkhaneliman
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill helps replace verbose if-then-else blocks in Nix configurations with reusable lib.mkIf, lib.optionals, lib.optionalString, and lib.mkMerge patterns, reducing duplication and improving maintainability.

Core Features & Use Cases

  • Use lib.mkIf to conditionally enable config blocks
  • Use lib.optionals to include conditional list items
  • Use lib.optionalString to conditionally inject strings
  • Use lib.mkMerge to combine conditional blocks
  • Apply in large Nix configurations across environments to tailor settings for different machines or users.

Quick Start

Add a small Nix snippet using lib.mkIf and lib.optionals in your configuration and run your regular rebuild to verify conditional blocks.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: nix-conditionals
Download link: https://github.com/khaneliman/khanelinix/archive/main.zip#nix-conditionals

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.