nixy - Simple Declarative Nix Package Management
Why nixy?
I was frustrated with asdf and Homebrew while working, and tried to learn Nix several times—but the steep learning curve made me give up every time. What I really wanted was a simple asdf/Homebrew alternative that uses Nix's massive package repository and reproducibility under the hood.
So I built nixy—a simple Rust wrapper with profile support. It runs smoothly and I love it.

Reproducible Nix packages, simple commands. Install packages with a single command, sync them across all your machines.
nixy manages your Nix packages through a declarative flake.nix + flake.lock, ensuring the same packages and versions on every machine.
Prerequisites
nixy requires Nix. Install with:
|
Quick Start
1. Install nixy
# Quick install (recommended)
|
# Or with cargo
# Or with nix
2. Set up your shell
Add to .bashrc, .zshrc, etc.:
For fish (~/.config/fish/config.fish):
nixy config fish | source
3. Start using
Commands
| Command | Description |
|---|---|
nixy install <pkg>[@version] |
Install a package with optional version (alias: add) |
nixy install --from <flake> <pkg> |
Install from a flake URL |
nixy install --file <path> |
Install from a nix file |
nixy uninstall <pkg> |
Uninstall a package (alias: remove) |
nixy list |
List installed packages with versions (alias: ls) |
nixy search <query> |
Search for packages with version info |
nixy upgrade [pkg...] |
Upgrade packages within version constraints |
nixy sync |
Rebuild from flake.nix |
nixy profile |
List profiles + interactive TUI selection |
nixy profile <name> |
Switch to profile |
nixy profile <name> -c |
Create and switch to profile |
nixy profile <name> -d |
Delete profile (with confirmation) |
nixy file <pkg> |
Show path to package source file in Nix store |
nixy self-upgrade |
Upgrade nixy itself |
Version Specification
nixy supports flexible version constraints via Nixhub:
When you run nixy upgrade nodejs, it respects your version constraint:
nodejs(no version) → upgrades to absolute latestnodejs@20→ upgrades to latest 20.x.x
Profiles
Maintain separate package sets for different contexts:
Each profile has its own flake.nix at ~/.config/nixy/profiles/<name>/.
How nixy works
nixy is purely declarative - packages.json is the source of truth, and flake.nix is regenerated from it on every operation.
┌─────────────────┐ ┌─────────────┐ ┌─────────────────────────────┐
│ packages.json │ ──── │ flake.nix │ ──── │ ~/.local/state/nixy/env/bin │
│ (source of truth)│ generate │ (+ flake.lock)│ nix build │ (symlink to /nix/store) │
└─────────────────┘ └─────────────┘ └─────────────────────────────┘
│
▼
eval "$(nixy config zsh)" adds
this path to your $PATH
Unlike nix profile which maintains mutable state, nixy:
- Regenerates
flake.nixfrompackages.jsonon every operation - Runs
nix buildto create a combined environment in/nix/store - Creates a symlink at
~/.local/state/nixy/envpointing to that environment - Your shell config just adds
~/.local/state/nixy/env/binto$PATH
This means syncing is simple: copy packages.json + flake.lock to another machine, run nixy sync, and you have the exact same environment.
FAQ
How do I find the right package name?
Use nixy search <keyword>.
Where are packages installed?
In /nix/store/. nixy creates a symlink at ~/.local/state/nixy/env pointing to your environment.
Can I edit flake.nix manually?
No, it's regenerated from packages.json on every operation. Use --from or --file for custom packages.
How does nixy differ from nix profile?
nixy adds reproducibility on top of Nix - your packages.json + flake.lock can be synced and version controlled across machines.
How do I rollback?
Version control your packages.json and flake.lock with git:
Advanced
~/.config/nixy/profiles/default/
├── packages.json # Source of truth
├── flake.nix # Generated (do not edit)
├── flake.lock # Nix lockfile
└── packages/ # Custom package definitions
From external flake:
From nix file:
Files in packages/ directory are auto-discovered.
You can import nixy's package list into your own flake:
{
inputs.nixy-packages.url = "path:~/.config/nixy/profiles/default";
outputs = { self, nixpkgs, nixy-packages }: {
# nixy-packages.packages.<system>.default is a buildEnv with all packages
};
}
nixy and nix profile use separate paths and don't conflict.
| Path | Description |
|---|---|
~/.config/nixy/profiles/<name>/packages.json |
Package state |
~/.config/nixy/profiles/<name>/flake.nix |
Generated flake |
~/.config/nixy/profiles/<name>/flake.lock |
Nix lockfile |
~/.config/nixy/active |
Current profile |
~/.local/state/nixy/env |
Symlink to environment |
Environment variables: NIXY_CONFIG_DIR, NIXY_ENV
License
MIT