ZSH Completions for Nix
Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes Another attempt to fix GitHub syntax highlighting Feb 13, 2015
ISSUE_TEMPLATE.md Update issue template Feb 8, 2018
LICENSE Fix license formatting Feb 12, 2015
README.md readme: Update installation description for NixOS Mar 11, 2018
_nix Complete channels for all commands Apr 21, 2018
_nix-build Fix --expr handling Nov 26, 2017
_nix-channel Handle nix-channel --list being empty Nov 6, 2017
_nix-collect-garbage Completions for --option and general cleanup Nov 24, 2015
_nix-common-options Bugfix: `nix-env -iA` completion failed when defexpr contained duplic… Jul 1, 2018
_nix-copy-closure Move common options out of nix.plugin.zsh Nov 24, 2015
_nix-env Fix compatibility with zsh 5.2 Dec 5, 2017
_nix-hash legacy: Add sha512 as a supported hash type Nov 22, 2017
_nix-install-package Move common options out of nix.plugin.zsh Nov 24, 2015
_nix-instantiate Fix `_files -/` usage Feb 8, 2018
_nix-prefetch-url legacy: Add sha512 as a supported hash type Nov 22, 2017
_nix-push Fix `_files -/` usage Feb 8, 2018
_nix-shell nix-shell: Add completion for --run Jun 12, 2018
_nix-store Fix `_files -/` usage Feb 8, 2018
_nixops nixops: -I should be handled by _nix_complete_includes Nov 24, 2017
_nixos-build-vms Completions for --option and general cleanup Nov 24, 2015
_nixos-container Add update command to nixos-container Nov 25, 2015
_nixos-generate-config Fix `_files -/` usage Feb 8, 2018
_nixos-install Fix `_files -/` usage Feb 8, 2018
_nixos-rebuild _nixos_rebuild: s/install-grub/install-bootloader Aug 12, 2018
_nixos-version Add completion for nixos-version Nov 24, 2015
init.zsh prompt for nix-shell and init.zsh hook for pretzo Nov 27, 2015
nix.plugin.zsh Fix $NIX_SHELL detection Jun 28, 2018

README.md

ZSH Completions for Nix and NixOS

This project aims to provide a highly complete set of ZSH completions for Nix, NixOS, NixOps, and the surrounding ecosystem.

NixOS

Setting programs.zsh.enable = true in /etc/nix/configuration.nix will automatically install and enable nix-zsh-compeletions.

Oh-My-ZSH Installation

git clone git@github.com:spwhitt/nix-zsh-completions.git ~/.oh-my-zsh/custom/plugins/nix

Then add nix to the plugins list in ~/.zshrc

If you want your prompt to be prefixed by [nix-shell] when you're in a nix-shell add this to your zshrc:

prompt_nix_shell_setup

Antigen Installation

Add the following to ~/.zshrc

antigen bundle git@github.com:spwhitt/nix-zsh-completions.git

Plain ZSH Installation

Clone this repository and add the following to ~/.zshrc with the path to nix-zsh-completions updated as necessary.

source $HOME/nix-zsh-completions/nix.plugin.zsh
fpath=($HOME/nix-zsh-completions $fpath)
autoload -U compinit && compinit

Required ZSH version

The completion scripts are known to be broken in ZSH version 5.0.8 or older, 5.2 or newer works.

ZSH Completions Tutorial

zsh-completions-howto