olafkfreund/nix-skills

nix-workflow

Choose Nix commands, locate store paths and libraries, use development shells, debug builds, configure Nix and navigate ecosystem tools.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/olafkfreund/nix-skills --skill nix-workflow

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Nix workflow

Establish the context before advising. Read the repository's own instructions. Check nix --version, since Nix, Lix and Determinate Nix differ. Check whether nix-command and flakes are enabled (nix config show experimental-features), and whether the project pins inputs with a flake, npins, niv or channels. Advice that fits one of these can be wrong for another.

Rules

  1. Never search `/nix/store` by brute force. A find or ls over the store

only sees what happens to be built locally. It misses everything else, and a path copied from it breaks as soon as the store changes. Use nix-locate to find which package provides a file. Use store queries (nix path-info, nix why-depends) for dependencies. Refer to libraries through Nix expressions such as ${pkgs.openssl.out}/lib or lib.makeLibraryPath, never through literal store paths.

  1. Use the right environment.
  • For a project, use its devShells output with nix develop.
  • For a tool the user needs for a moment, use nix shell nixpkgs#tool.
  • For one program, use nix run.
  • Do not install into the user's profile or system to satisfy one project.
  1. Search before inventing. When a build or package fails:
  • Read the full log with nix log.
  • Search NixOS/nixpkgs issues and pull requests for the distinctive error

text.

  • Report what you found, with numbers, before proposing a workaround.

Do not disable the sandbox, checks or hardening to make an error disappear.

  1. Use the smallest adequate tool. Inspect and transform data with jq,

awk, sed, grep and nix subcommands such as nix eval --json and nix derivation show. Write Python or another script only when the logic needs it.

  1. Know where a setting lives. Nix settings belong to the client, the

daemon or a remote builder. Some take effect only for trusted users. On NixOS, nix-darwin and Home Manager, Nix configuration is declarative, and generated files are not edited by hand. Do not edit nix.conf, add trusted users or substituters, collect garbage, or switch a system without the user's explicit authorization. Propose the change instead.

  1. Treat ecosystem facts as perishable. Tools and lang2nix projects are

archived, renamed or replaced often. Before recommending one, check its upstream repository for its status and any successor. Prefer the Nixpkgs language builders first.

Nix style

  • Never search /nix/store (for example find /nix/store/*foo-* -name libfoo.so)

and never copy a literal store path. Find the providing package with nix-locate, and refer to it through Nix: ${pkgs.foo}/lib or lib.makeLibraryPath [ pkgs.foo ].

  • Do not quote attribute names that are valid identifiers

([A-Za-z_][A-Za-z0-9_'-]*, dashes included). Write pkgs.foo-bar and packages.x86_64-linux, not pkgs."foo-bar". Quote only other names (".config/foo", "2.0"), the keywords assert else if in inherit let or rec then with, and interpolations ("${name}"). Upstream examples in references sometimes quote needlessly; do not copy that style.

References

file, store and dependency queries, and referring to libraries from Nix.

  • Shells: nix develop, nix shell, nix run,

defining devShells, direnv, and project versus host tools.

errors, reading logs, and searching Nixpkgs issues, pull requests and Hydra.

client and daemon, trusted users, caches, remote builders and declarative owners.

frameworks, Nix implementations and lang2nix status.

Other skills by role

These skills belong to the same collection, but may not all be installed. If one is missing, use the linked upstream documentation instead.

RoleTypical needUse
DeveloperProject environment, expressionsThis skill for shells; devenv-project for devenv (devenv.sh); nix-language for the language (Nix manual)
PackagerDerivations, overrides, overlaysnixpkgs-development (Nixpkgs manual)
Home Manager user, including darwinUser configurationhome-manager (Home Manager manual)
macOS system administratornix-darwin system configurationnix-darwin (nix-darwin)
NixOS administratorSystem configuration and rebuildsnixos-operations for rebuilds, generations, upgrades, store cleaning, boot and services; nixos-wiki for community guidance (NixOS manual, NixOS Wiki)
AI coding agent userChoosing, installing and sandboxing coding agentsnixos-coding-agents (llm-agents.nix, agent-images, agent-box)
VM userDeclarative microVMsmicrovm-nix (microvm.nix)

Report what you actually ran, which commands only evaluated and which built or changed anything, and which advice you could not verify on the user's version.

같은 저장소의 Skills

더 많은 Skills

모든 Skills