Providing reproducible environments for all developers
LazyNix makes Nix development environments accessible through simple YAML configuration.
- π Simple: Write YAML instead of Nix expressions
- π Reproducible: Powered by Nix flakes for deterministic builds
- π― Focused: Designed for DevShell only - when you need more, just use the generated
flake.nix
We recommend using Nix to install LazyNix. If you don't have Nix installed yet, get it from nixos.org/download.
Alternatively, you can use pre-built binaries from the release page or build from source.
Try LazyNix without installing anything. Run it directly from GitHub using nix run:
# Display help
nix run github:shunsock/lazynix -- --help
# Initialize a new project
nix run github:shunsock/lazynix -- init
# Enter development environment
nix run github:shunsock/lazynix -- developFor permanent installation, add LazyNix to your Nix profile:
# Install from GitHub
nix profile install github:shunsock/lazynix
# Then use the lnix command directly
lnix --help
lnix init
lnix developDownload platform-specific binaries from GitHub Releases.
curl -L -o lnix https://github.com/shunsock/LazyNix/releases/latest/download/lnix-x86_64-linux
chmod +x lnix
sudo mv lnix /usr/local/bin/curl -L -o lnix https://github.com/shunsock/LazyNix/releases/latest/download/lnix-aarch64-linux
chmod +x lnix
sudo mv lnix /usr/local/bin/curl -L -o lnix https://github.com/shunsock/LazyNix/releases/latest/download/lnix-aarch64-darwin
chmod +x lnix
sudo mv lnix /usr/local/bin/Clone the repository and build using Nix:
# Clone the repository
git clone https://github.com/shunsock/lazynix.git
cd lazynix
# Build with Nix
nix build
# Run the built binary
./result/bin/lnix --helpCreate a new LazyNix configuration in your project directory:
lnix initThis creates two files:
- π
lazynix.yaml- Your environment configuration (edit this) - βοΈ
flake.nix- Generated Nix flake (auto-generated, don't edit)
Edit lazynix.yaml to specify your development tools. Find packages at search.nixos.org.
devShell:
allowUnfree: true
package:
stable:
- python312
- uv
unstable: []
shellHook:
- "echo Python $(python --version) ready!"
- "echo uv $(uv --version) ready!"
env:
# Load from .env files
dotenv:
- .env
# Define variables directly
envvar:
- name: PYTHONPATH
value: ./src
- name: DEBUG
value: "true"Activate your configured environment:
lnix developLazyNix will automatically:
- π Read your
lazynix.yamlconfiguration - π§ Generate the
flake.nixfile - π Update
flake.lockwith pinned dependencies (with--update) - π Enter the Nix development shell with all specified packages
By default, LazyNix looks for lazynix.yaml and lazynix-settings.yaml in the current directory. You can customize this location using either a CLI flag or environment variable.
1. CLI Flag (Recommended for one-off usage)
Use the --config-dir flag (or -C short form) before the subcommand:
lnix --config-dir ./configs develop
lnix -C ./configs develop # Short form2. Environment Variable (Recommended for persistent setup)
Set the LAZYNIX_CONFIG_DIR environment variable:
LAZYNIX_CONFIG_DIR=./configs lnix develop
# Or export for the entire session
export LAZYNIX_CONFIG_DIR=./configs
lnix init
lnix developLazyNix supports an optional lazynix-settings.yaml file for system-level customization. This file is completely optional - LazyNix works perfectly without it using sensible defaults.
When to use settings:
- Override nixpkgs versions (use older/newer packages)
By default, LazyNix uses nixos-25.11 for stable packages. You can override this in lazynix-settings.yaml:
# lazynix-settings.yaml
override-stable-package: "github:myorg/nixpkgs/custom-branch"- Reproducible Development Environments: Consistent, shareable dev setups
- Simple Configuration Interface: YAML instead of Nix expressions
- Cover All Nix Features: No build definitions, overlays, or modules
- Replace Nix: It's a thin layer on top of Nix flakes
- Manage System Configuration: Only development environments
When you need advanced Nix features, migration is seamless. LazyNix generates a standard flake.nix, so:
- ποΈ Delete
lazynix.yaml - βοΈ Continue editing
flake.nixdirectly
That's all! Your development environment keeps working without any changes.
We welcome contributions!
This project is licensed under the MIT License.
