A caching layer for nix-shell that provides instant startup time on subsequent runs by storing and reusing environment variables.
cached-nix-shell is a caching layer for nix-shell that provides instant startup time on subsequent runs by storing and reusing environment variables. It solves the problem of slow nix-shell initialization by caching evaluation results and automatically invalidating the cache when dependencies change.
Nix and NixOS developers who frequently use nix-shell for development environments and want to eliminate startup delays.
Developers choose cached-nix-shell because it offers dramatic performance improvements for nix-shell workflows while maintaining correctness through intelligent cache invalidation, making it a reliable drop-in replacement.
Instant startup time for nix-shell
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Subsequent runs complete in milliseconds by reusing cached environment variables, as shown in performance examples where startup time drops from 0.435s to 0.029s.
Traces files read during Nix evaluation and automatically invalidates cache when dependencies like imported Nix files or configs change, ensuring correctness without manual effort.
Works as a drop-in replacement for nix-shell in shebang lines or commands, requiring no changes to existing scripts for immediate speed gains.
Can wrap tools like stack that internally call nix-shell using the --wrap option, extending caching benefits to broader development workflows without modification.
Cache invalidation does not handle builtins.fetchurl or similar network calls, as admitted in the README, risking stale environments in projects with online dependencies.
Only supports NixOS and Linux, excluding other operating systems where Nix is used, such as macOS, limiting its adoption in mixed environments.
Cache stored in ~/.cache/cached-nix-shell/ may require manual cleanup if corrupted or in edge cases not covered by tracing, adding maintenance complexity.