A development shell supplies project tools without making them permanent global packages. Everyone using the locked flake gets the same package definitions.
In the output attribute set in flake.nix, keep the package output and add:
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
git
nixfmt
ripgrep
];
};
formatter.${system} = pkgs.nixfmt;Attribute names such as devShells.x86_64-linux.default are an interface:
nix develop looks there by convention.
nix flake show
nix develop
rg --version
nixfmt --version
exit
nix fmt -- --check flake.nixIf the formatter reports a difference, run nix fmt flake.nix, inspect the
diff, and learn what changed.
git diff
git add flake.nix
git diff --staged
git commit -m "feat: add a reproducible Nix workbench"Explain when a tool belongs in a development shell and when it should eventually belong in the laptop's system packages.
-
nix developopens my reproducible workbench. - I verified that the declared tools are available inside it.
-
nix fmt -- --check flake.nixpasses. - I can explain the standard
devShellsandformatteroutput names. - I inspected and committed the change.
- I ticked Lesson 05 in PROGRESS.md.
Next: Lesson 06.