← ClaudeAtlas

nix-flakelisted

Set up a reproducible Nix development environment for any Git repository — create a flake.nix with a devshell so `nix develop` provides the project's toolchain (cargo/clippy, go/gopls, python/pytest/black, node, ...) without global installs, fix a missing or broken flake.nix, port a legacy shell.nix/default.nix to a flake, diagnose `nix develop` errors such as "does not contain a flake.nix", enforce a policy that every repo must have a flake.nix, or migrate an existing flake away from flake-utils. Use this skill whenever the user wants a project's environment reproducible with Nix, asks for a devshell/dev shell setup, mentions flake.nix or nix develop while working on a project, or asks to get set up hacking on a freshly cloned repo — and proactively check whether the Git repo you are working in has a flake.nix, offering to add one when missing. Writes flakes using the official default template pattern (builtins.mapAttrs over nixpkgs.legacyPackages, never flake-utils) and verifies them by evaluation and build
atvari-eu/nix-skills · ★ 0 · AI & Automation · score 70
Install: claude install-skill atvari-eu/nix-skills
# Nix Flake Every repository an agent works in should have a `flake.nix`. It gives you — and any human or agent that comes after you — a one-command, reproducible toolchain: `nix develop` drops into a shell with the project's compiler, package manager, and linters, independent of whatever happens to be installed on the host. This skill covers two things: noticing when a repo is missing its `flake.nix`, and writing a good one. The template below is the official default since August 2026 ([NixOS/templates#103](https://github.com/NixOS/templates/pull/103)), explained in depth by [Nixcademy](https://nixcademy.com/posts/new-default-nix-flake-template/). ## Checking for a flake When you start working in a Git repository, check whether a `flake.nix` already exists at the repo root: ```bash test -f "$(git rev-parse --show-toplevel)/flake.nix" ``` - **If it exists**, carry on with the user's task. Nothing to do here. (Exception: if it uses `flake-utils`, you may offer a migration — see [Migrating away from flake-utils](#migrating-away-from-flake-utils).) - **If it is missing**, offer to add one as part of your work: a single sentence like *"This repo has no flake.nix — want me to add one with a dev shell for <detected stack>?"* Then continue with what the user actually asked. Do not silently create files in someone else's project, but do not nag either: if they decline, drop it and move on. - Ask which toolchain belongs in the dev shell only if the project type is