
Nix Best Practices
This one covers the practical patterns you actually need when setting up Nix flakes: proper use of follows to avoid downloading nixpkgs multiple times, how to apply overlays correctly, and handling unfree packages without fighting the tooling. The binary overlay pattern is especially useful if you're dealing with open-core tools where the nixpkgs version is missing features. It also walks through dev shell configurations with native dependencies and environment variables, plus the common gotchas like why config.allowUnfree doesn't work with nix develop. Good reference if you're past the hello world stage but still hitting walls with flake architecture decisions.
- skills.sh installs
- 359
- GitHub stars
- 48
- last updated
- Jun 3, 2026
Install
$ npx -y skills add 0xbigboss/claude-code --skill nix-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Nix Best Practices
Flake Structure
Standard flake.nix structure:
{
description = "Project description";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# packages here
];
};
});
}
Follows Pattern (Avoid Duplicate Nixpkgs)
When adding overlay inputs, use follows to share the parent nixpkgs and avoid downloading multiple versions:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Overlay follows parent nixpkgs
some-overlay.url = "github:owner/some-overlay";
some-overlay.inputs.nixpkgs.follows = "nixpkgs";
# Chain follows through intermediate inputs
another-overlay.url = "github:owner/another-overlay";
another-overlay.inputs.nixpkgs.follows = "some-overlay";
};
All inputs must be listed in outputs function even if not directly used:
Sponsors
Details
- Repository
- github.com/0xbigboss/claude-code
- First seen
- Jun 3, 2026
More from 0xbigboss/claude-code
All 22- Tamagui Best Practices290
- Openai Image Gen288
- Go Best Practices272
- Playwright Best Practices266
- Axe Ios Simulator239
- Electrobun Best Practices209
- Tilt196
- Orbstack Best Practices180
- Canton Network Repos157
- Ios Device Screenshot155
- Atlas Best Practices154
- Git Best Practices149
- Git Rebase Sync146
- Testing Best Practices135
- E2e126
- Extract Transcripts122
- React Best Practices3K
- Typescript Best Practices2.9K
- Python Best Practices1.8K
- Web Fetch929
- Zig Best Practices388