mise-nix
is a backend plugin for Mise that allows you to install and manage packages using Nix.
- π Access to over 100,000 packages
- β‘ Better Nix developer experience
- π¦ Install VSCode extensions
mise plugin install nix https://github.com/jbadeau/mise-nix.git
# List available versions
mise ls-remote nix:hello
# Install version
mise install nix:[email protected]
Uses nixhub.io for pre-built, cached packages:
# Latest version
mise install nix:hello
# Specific version
mise install nix:[email protected]
# Version aliases
mise install nix:hello@stable
Uses GitHub shorthand for fast access:
# From nixpkgs GitHub repository (default branch)
mise install "nix:hello@github+nixos/nixpkgs"
# From specific branch
mise install "nix:hello@github+nixos/nixpkgs/nixos-unstable"
# From specific release/tag
mise install "nix:hello@github+nixos/nixpkgs?ref=23.11"
# From specific commit SHA
mise install "nix:hello@github+nixos/nixpkgs/abc123def456"
# With revision parameter
mise install "nix:hello@github+nixos/nixpkgs?rev=abc123def456"
# With subdirectory (flake in subdirectory)
mise install "nix:mytool@github+company/monorepo/main?dir=packages/tool"
# GitHub shorthand syntax (alternative)
mise install "nix:hello@nixos/nixpkgs#hello"
Uses GitLab shorthand:
# From GitLab repository
mise install "nix:mytool@gitlab+group/project"
Uses full Git URLs for maximum compatibility:
# From raw git URL
mise install "nix:hello@git+https://github.com/nixos/nixpkgs.git"
For development with local Nix flakes:
export MISE_NIX_ALLOW_LOCAL_FLAKES=true
# Local development
mise install "nix:mytool@./my-project"
Install VSCode extensions using vscode+install syntax. Extensions are installed by creating a VSIX package from the Nix store and installing it in VSCode:
mise install "nix:vscode+install=vscode-extensions.golang.go"
The extension files are symlinked for access, and a VSIX package is created and installed in VSCode for IDE integration.
Due to mise's argument parsing limitations, some Git URL formats require workarounds:
# β Not supported (direct prefixes with colons)
mise install nix:hello@github:nixos/nixpkgs#hello
mise install nix:mytool@gitlab:group/project#default
# β
Use these workarounds instead
mise install "nix:hello@github+nixos/nixpkgs"
mise install "nix:mytool@gitlab+group/project"
Mise rejects git+ssh://
and git+https://
as invalid prefixes, so use these alternatives:
Prefix | Converts To | Use Case |
---|---|---|
ssh+git@host/repo.git |
git+ssh://git@host/repo.git |
SSH access |
https+user:token@host/repo.git |
git+https://user:token@host/repo.git |
HTTPS auth |
# β These don't work due to mise parsing
mise install "nix:hello@git+ssh://[email protected]/nixos/nixpkgs.git"
mise install "nix:hello@git+https://user:[email protected]/nixos/nixpkgs.git"
# β
Use these workarounds instead
mise install "nix:hello@[email protected]/nixos/nixpkgs.git"
mise install "nix:hello@https+user:[email protected]/nixos/nixpkgs.git"
# Custom NixHub instance
export MISE_NIX_NIXHUB_BASE_URL="https://custom-nixhub.example.com"
# Custom NixPkgs repository
export MISE_NIX_NIXPKGS_REPO_URL="https://github.com/custom/nixpkgs"
# Enable local flakes (security risk)
export MISE_NIX_ALLOW_LOCAL_FLAKES=true
# Enterprise Git instances
export MISE_NIX_GITHUB_ENTERPRISE_URL="github.company.com"
export MISE_NIX_GITLAB_ENTERPRISE_URL="gitlab.company.com"
Important: Add to ~/.config/nix/nix.conf
for optimal performance:
experimental-features = nix-command flakes
substituters = https://cache.nixos.org https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:0VI8sF6Vsp2Jxw8+OFeVfYVdIY7X+GTtY+lR78QAbXs=
Without this configuration, package installations will be significantly slower as Nix will build from source instead of using pre-built binaries.
"Package not found": Check package exists on NixHub
"Invalid prefix": Use github+
syntax instead of direct github:
"Local flakes disabled": Set MISE_NIX_ALLOW_LOCAL_FLAKES=true
Build failures: Ensure Nix experimental features are enabled
Slow installs: Avoid full git URLs for large repositories
VSCode extensions not showing: Restart VSCode after installing extensions
# Setup
mise init # Install and link
# Tests
mise test # Unit tests
mise e2e # Integration tests