From df3bc8ec2810fcf21a024da75d576c56ef309264 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Fri, 23 Oct 2026 13:09:25 -0500 Subject: [PATCH] fix(nix-devshell): permit missing pin in inventory and complete multi-system pattern --- skills/nix-devshell/SKILL.md | 9 ++++---- .../references/authoring-patterns.md | 21 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/skills/nix-devshell/SKILL.md b/skills/nix-devshell/SKILL.md index 779e3f8..b7559cc 100644 --- a/skills/nix-devshell/SKILL.md +++ b/skills/nix-devshell/SKILL.md @@ -15,10 +15,11 @@ description: >- containers, or devenv/devbox/flox. Lock updates go to `inspect-flake-update`. ## Steps -1. **Inspect before deciding.** Read the Nix files, `flake.lock` (pinned nixpkgs revision), - `.envrc`, language manifests, build scripts, CI, contributor docs, `git status`, and - `nix --version` with enabled features. Write a short inventory of what exists and which - conventions (workflow, helper library, systems, constructor, input policy) you will keep. +1. **Inspect before deciding.** Read the Nix files, `flake.lock` (pinned nixpkgs revision, + or record that none is present), `.envrc`, language manifests, build scripts, CI, + contributor docs, `git status`, and `nix --version` with enabled features. Write a short + inventory of what exists and which conventions (workflow, helper library, systems, + constructor, input policy) you will keep. 2. **Establish requirements** from that evidence: tools, runtimes, native libraries, compiler, env vars, startup behavior, project commands, target systems. Ask only about gaps that change the design and cannot be read from the repo. diff --git a/skills/nix-devshell/references/authoring-patterns.md b/skills/nix-devshell/references/authoring-patterns.md index 520e4eb..55fdab9 100644 --- a/skills/nix-devshell/references/authoring-patterns.md +++ b/skills/nix-devshell/references/authoring-patterns.md @@ -62,14 +62,23 @@ Replace the system with the project's actual one(s); add systems only when requi dependencies support them. The nixpkgs branch is a project decision (see [design-decisions.md](design-decisions.md#3-nixpkgs-inputs-and-lock-policy)). -For several systems without an extra input (`Contextual`, one option among several): +For several systems without an extra input (`Contextual`, standalone minimal flake pattern): ```nix -let - systems = [ "x86_64-linux" "aarch64-darwin" ]; # only the systems the project needs - forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); -in { - devShells = forAllSystems (pkgs: { default = pkgs.mkShellNoCC { packages = [ pkgs.jq ]; }; }); +{ + description = "Multi-system development shell without extra inputs"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" "aarch64-darwin" ]; # only the systems the project needs + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); + in { + devShells = forAllSystems (pkgs: { + default = pkgs.mkShellNoCC { + packages = [ pkgs.jq ]; + }; + }); + }; } ```