a150408a5a
CI / check (push) Has been cancelled
(Set up Serena IDE integration with a Nix language server and create a memory graph documenting package conventions, core structure, tech stack, and task completion workflows.)
1.4 KiB
1.4 KiB
nix-overlay — package conventions
Directory pattern (every package)
packages/<name>/default.nix (wrapper, receives blueprint args) + packages/<name>/package.nix (the derivation, pkgs.callPackage-style argsets).
Wrapper variants:
- Plain:
{ pkgs, ... }: pkgs.callPackage ./package.nix { } - Needs blueprint extras: pass
perSystem,inputs, etc. through explicitly. - Alternate nixpkgs (freetoken): wrapper ignores
pkgsfor the derivation and callsinputs.nixpkgs-torch211.legacyPackages.${pkgs.stdenv.hostPlatform.system}.callPackage ./package.nix { }.
Derivedivation requirements
- Use
stdenv.mkDerivation rec { pname; version; }orrustPlatform.buildRustPackage(Rust:cargoHash; Go/Python equivalents as needed). meta.descriptionrequired (feeds the default meta-package listing).meta.mainProgramset for CLI-providing packages.- Organizational attrs via
passthru:category(e.g. "AI Coding Agents"),hideFromDocs = trueto exclude from docs listing. - No
with pkgs;at top level of Nix files (scope issues). - No hardcoded system paths/system assumptions.
Adding a package (sequence)
mkdir → package.nix → default.nix wrapper → git add packages/<name>/ (required for blueprint discovery) → nix build .#<name> → update README Available Packages table → commit (conventional-commit format).
Naming
- Package dir name = flake output attr name (kebab-case).