flk π
A modern CLI tool for managing Nix flake development environments with the simplicity of Devbox
flk makes managing Nix flakes feel like using a package manager. No more manually editing flake.nix files β just use simple commands to add packages, create custom shell commands, and manage your development environment.
β¨ Features
- π― Smart Initialization β Auto-detects your project type (Rust, Python, Node.js, Go)
- π¦ Easy Package Management β Add/remove packages, pin specific versions
- β‘ Custom Shell Commands β Define reusable commands for your workflow
- π Environment Variables β Manage per-project variables through the CLI
- π€ Multi-Profile Support β Maintain separate configurations within one project
- π Lock File Management β Backup, preview, and restore your
flake.lock - π³ Container Export β Export environments to Docker, Podman, or JSON
- π Hot Reload β Shell hooks for instant
refreshandswitchbetween profiles
β‘ Quick Start
See the Getting Started guide for a full walkthrough.
π¦ Installation
Prerequisites: Nix with flakes enabled β recommended via Lix or the Determinate installer.
| Method | Command |
|---|---|
| Cargo | cargo install flk |
| Nix (run) | nix run github:AEduardo-dev/flk#flk |
| Nix (install) | nix profile install github:AEduardo-dev/flk#flk |
| From source | git clone β¦ && cd flk && cargo install --path . |
| Binaries | GitHub Releases |
| Cachix | cachix use flk-cache (prebuilt Nix binaries) |
For Nix flake input, overlay, and Home Manager options see the Installation guide.
Shell Hook (optional)
Enable hot-reload (refresh) and profile switching (switch):
π Commands
| Command | Description |
|---|---|
flk init |
Initialize a new flake environment |
flk add / remove |
Add or remove packages (--version to pin) |
flk search / deep-search |
Search nixpkgs |
flk list / show |
List packages or pretty-print full config |
flk cmd add|remove|list |
Manage custom shell commands |
flk env add|remove|list |
Manage environment variables |
flk profile add|remove|list|set-default |
Manage profiles |
flk activate |
Enter the dev shell |
flk update |
Update flake inputs (auto-backup) |
flk lock show|history|restore |
Manage flake.lock snapshots |
flk export |
Export to Docker, Podman, or JSON |
flk direnv init|attach|detach |
Direnv integration |
flk hook <shell> |
Generate shell hooks |
flk completions |
Generate shell completions |
Most commands accept -p, --profile <NAME> to target a specific profile.
Full command reference β Commands documentation
π οΈ Development
&&
&&
See the Development guide for project structure, testing details, and CI info.
π Documentation
| Resource | Link |
|---|---|
| User Guide (mdBook) | aeduardo-dev.github.io/flk |
| API Reference | docs.rs/flk |
Build locally:
# User guide β serve with live reload
&&
# Rust API docs
# Both via Nix
πΊοΈ Roadmap
π€ Contributing
Contributions welcome! See CONTRIBUTING.md for details. For bugs, please open an issue with reproduction steps and environment info.
π Related Projects
- Devbox β Instant, portable dev environments (inspiration for flk)
- devenv β Fast, declarative developer environments
- Flox β Developer environments you can take with you
- direnv β Shell extension for loading environments
π License
MIT β see LICENSE for details.
π Acknowledgments
- The Nix community for creating an amazing ecosystem
- Jetify for the Devbox inspiration
- Special mention to @vic for nix-versions
- All contributors and users of flk
Made with β€οΈ by AEduardo-dev