No description
Find a file
2025-08-03 22:40:51 +02:00
default.nix Add README and default.nix 2025-08-03 22:40:51 +02:00
format Update auto-formatting script 2025-08-03 22:40:51 +02:00
nix-dev Reorder functions 2025-08-03 22:40:51 +02:00
package.nix Initial code import 2025-08-03 22:40:51 +02:00
README.md Add README and default.nix 2025-08-03 22:40:51 +02:00
shell.nix Initial code import 2025-08-03 22:40:51 +02:00

nix-dev

A tool to simplify the management of Nix development environments by caching environments defined by shell.nix files. By keeping symlinks to derivation and the build output, the environment will not be garbage collected by nix-collect-garbage. It supports features like garbage collection to clean up stale environments.

Installation

git clone https://git.stha.de/stefan/nix-dev.git
nix-env -i -f nix-dev/package.nix

Usage

Basic usage: Run in a directory with shell.nix:

nix-dev

Specify a different shell file:

nix-dev my-shell.nix

Force environment recreation:

nix-dev --break-cache

Clean up environments:

nix-dev --collect-garbage

For more options, run:

nix-dev --help

Features

  • Caches environments based on shell.nix content for quick reuse.
  • Prevents nix-collect-garbage from deleting the environment.
  • Automatically cleans up stale environments.