Skip to content
devops4 active rulesVerified 2026-09-30

Nix .gitignore Template

Standard Nix gitignore template from upstream github/gitignore collection. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.

Interactive Stack Generator

Preconfigured with Nix
Search for templates
Quick add:
Selected1
Nix
Selected Templates (1)
.gitignore
4 rules
### Nix ###
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
# Ignore automatically generated direnv output
.direnv
# Ignore NixOS interactive test driver history
**/.nixos-test-history
11 lines•UTF-8
Deterministic

Raw Nix .gitignore

Crawlable upstream source template
nix.gitignore•10 lines•UTF-8
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
# Ignore automatically generated direnv output
.direnv
# Ignore NixOS interactive test driver history
**/.nixos-test-history

Key Pattern Breakdown

Core Ignored Rules

Primary upstream ignore rules defined for this technology.

resultresult-*.direnv**/.nixos-test-history

Source & Verification

License: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.