Introduction
flk is a modern CLI for managing Nix flake development environments with the simplicity of tools like Devbox. It gives you an intuitive interface for working with flakes without manually editing configuration files.
Meet Flik
Up top is Flik, the magenta bird with a snowflake on his head. The wordplay does triple duty:
- flk is the command you type — short, lowercase, easy to reach for.
- Flik is the personification — one letter longer, mascot-ified, the friendly face.
- flock is the conceptual payoff — every flake
flkmanages is itself a flock of inputs (nixpkgs, your overlays, pinned libraries, profile registries).flkis the manager that keeps that flock together; Flik is the one carrying the flake.
You’ll see Flik animate in the terminal during long-running operations like flk update and flk export — a calm thinking pose while work happens, then a wing-up hop on success or a cool half-lidded pose on failure.
Why flk?
- 🎯 Smart Initialization: Auto-detects your project type
- 📦 Easy Package Management: Add/remove packages with simple commands
- ⚡ Custom Commands: Define reusable shell commands
- 🌍 Environment Management: Manage environment variables easily
- 👤 Multi-Profile Support: Maintain separate flocks within one project
- 🔒 Lock File Management: Version control for your dependencies
Quick Example
# Initialize a Rust project
flk init
# Add packages (Flik fetches the pin)
flk add ripgrep fd-find
# Define a custom command
flk cmd add build "cargo build --release"
# Enter the development environment
nix develop
# Use your custom command
build
Upgrading to v0.5.X (switch/refresh changes)
WARNING (pre v0.5.0 users): If you are using flk < v0.5.0 and you run flk update / nix flake update, your devshell switch / refresh behavior may break because the nix-profile-lib input may update to a newer version with different activation semantics.
If you intend to stay on flk < v0.5.0, use one of these options:
-
Do not update flake inputs. Avoid running
flk updateornix flake update. If you already did, restore a previous lockfile backup with:flk lock restore <BACKUP> -
Pin
nix-profile-libto v0.1.0. In yourflake.nix:inputs = { nix-profile-lib.url = "git+https://gitlab.com/pixel-racks/flakes/nix-profile-lib?ref=v0.1.0"; };Then update the lock entry:
nix flake lock --update-input nix-profile-lib(or
nix flake update --update-input nix-profile-lib)
Once you upgrade to flk v0.5.0+, this restriction is lifted.
Documentation Structure
- User Guide: Learn how to use flk effectively
- Commands: Detailed reference for all commands
- Advanced Topics: Deep dives into specific features
- API Documentation: Internal API reference for contributors