スキル一覧に戻る
knoopx

nh

by knoopx

pi.ai config

2🍴 0📅 2026年1月21日
GitHubで見るManusで実行

SKILL.md


name: nh description: Manage NixOS and Home Manager operations with improved output and cleanup. Use when updating NixOS configurations, managing user environments, cleaning up generations, or performing system maintenance.

nh (Nix Helper) Skill

nh is a CLI tool that simplifies Nix operations, providing a cleaner interface for builds, switches, and garbage collection.

Core Commands

System Updates (NixOS)

Use nh os for managing NixOS configurations. Prefix local paths with path:.

# Build and switch to a configuration (equivalent to nixos-rebuild switch)
nh os switch path:.

# Build and test a configuration (equivalent to nixos-rebuild test)
nh os test path:.

# Build a configuration without switching (equivalent to nixos-rebuild build)
nh os build path:.

Home Manager Updates

Use nh home for managing Home Manager configurations.

# Build and switch Home Manager configuration
nh home switch path:.

# Build Home Manager configuration without switching
nh home build path:.

Maintenance and Cleanup

nh clean provides a more intuitive way to manage the Nix store and generations.

# Clean generations older than 7 days
nh clean all --keep-since 7d

# Keep only the last 5 generations
nh clean all --keep 5

# Run garbage collection on the Nix store
nh clean all

Common Options

  • --ask: Ask for confirmation before performing actions (Avoid in headless/automated scripts).
  • --dry: Show what would happen without making changes.
  • --update: Update flake inputs before building.

Best Practices

  • Headless Usage: Avoid using the --ask flag in scripts or automated environments as it requires user interaction.
  • Path Inference: nh automatically looks for a flake.nix in the current directory if no path is provided.
  • Visuals: nh provides a more readable "Nom-like" output by default, which is helpful for monitoring build progress in a terminal.
  • nix: Use Nix for running applications without installation and evaluating Nix expressions.
  • nix-flakes: Leverage Nix Flakes for reproducible builds and project isolation with nh.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です