Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:luc14n0
nix
nix-zsh-completions.obscpio
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nix-zsh-completions.obscpio of Package nix
07070100000000000081A4000000000000000000000001650347180000001B000000000000000000000000000000000000002300000000nix-zsh-completions/.gitattributes_* linguist-language=Shell 07070100000001000041ED0000000000000000000000026503471800000000000000000000000000000000000000000000001C00000000nix-zsh-completions/.github07070100000002000041ED0000000000000000000000026503471800000000000000000000000000000000000000000000002600000000nix-zsh-completions/.github/workflows07070100000003000081A40000000000000000000000016503471800000262000000000000000000000000000000000000002F00000000nix-zsh-completions/.github/workflows/test.ymlname: test on: pull_request: types: - opened - synchronize branches: - master push: branches: - master jobs: tests: name: Run tests runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest] steps: - name: Set up git repository uses: actions/checkout@v2 - name: Install zsh if: runner.os == 'Linux' run: sudo apt-get update; sudo apt-get install zsh - name: Check syntax run: | for file in _* *.zsh; do zsh -n "$file" || return 1 done 07070100000004000081A400000000000000000000000165034718000004C2000000000000000000000000000000000000002600000000nix-zsh-completions/ISSUE_TEMPLATE.md<!-- Thank you for reporting an issue :) broken software is no fun for anyone :( To quickly figure out any problem there's some information that's often useful. Namely your system and a step by step explanation on how to reproduce the problem (or a completion trace if reproduction isn't clear) If the issue is a feature request or doesn't require this information you can omit it, deleting the `System` and `Completion trace` headers Lines wrapped with \<!-- ... --\> will be ignored, so you don't have to delete them. --> ### Description ### Reproduction steps <!-- Steps to reproduce the problem --> ### System - nix-zsh-completions version: <!-- version or git commit --> - ZSH version: <!-- print $ZSH_VERSION --> - NIX_PATH: <!-- print $NIX_PATH --> <!-- also run `nix-shell -p nix-info --run "nix-info -m"` and paste the result here --> ### Completion trace <!-- If the issue is elusive and you're unable to reproduce it conistently a completion trace of the failure can be useful. To produce a trace do this: Use the `Ctr-x ?` keybinding instead of tab (at the place tab fails). This will give you a file in `/tmp` with a full trace. Post the file to a gist service and include the link here. --> 07070100000005000081A400000000000000000000000165034718000005CE000000000000000000000000000000000000001C00000000nix-zsh-completions/LICENSECopyright (c) 2015, Spencer Whitt All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Spencer Whitt nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 07070100000006000081A40000000000000000000000016503471800000628000000000000000000000000000000000000001E00000000nix-zsh-completions/README.mdZSH Completions for Nix and NixOS ================================= This project aims to provide a highly complete set of ZSH completions for [Nix](https://nixos.org/nix/), [NixOS](https://nixos.org/), [NixOps](http://nixos.org/nixops/), and the surrounding ecosystem. NixOS ---------------------- Setting `programs.zsh.enable = true` in `/etc/nixos/configuration.nix` will automatically install and enable `nix-zsh-compeletions`. Oh-My-ZSH Installation ---------------------- ```zsh cd ~/.oh-my-zsh/custom/plugins git clone git@github.com:nix-community/nix-zsh-completions.git ``` Then add `nix-zsh-completions` 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` ```zsh antigen bundle git@github.com:nix-community/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. ```zsh source $HOME/nix-zsh-completions/nix-zsh-completions.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](https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org) 07070100000007000081A40000000000000000000000016503471800000324000000000000000000000000000000000000001F00000000nix-zsh-completions/_nix-build#compdef nix-build #autoload _nix-common-options local -a _nix_build_opts=( $__nix_expr_opts $__nix_common_store_opts '*'{--attr,-A}'[build a package from file (default: ./default.nix)]:package:_nix_complete_attr_paths' --check'[Rebuild derivation]' '--drv-link[Add a symlink to the store derivation]:Symlink Name:( )' '--add-drv-link[Shorthand for --drv-link ./derivation]' '--no-out-link[Do not create a symlink to the output path]' {--out-link,-o}'[Name of the output symlink]:Output Symlink Name:( )' ) # TODO: Undocumented args to possibly add # --add-root # --check # --quiet # --command # --exclude # --pure # --impure # --packages,-p _arguments \ $__nix_boilerplate_opts \ $__nix_common_opts \ $__nix_dry_run \ $_nix_build_opts \ '*:Paths:_nix_path' 07070100000008000081A4000000000000000000000001650347180000025C000000000000000000000000000000000000002100000000nix-zsh-completions/_nix-channel#compdef nix-channel #autoload local context state state_descr line typeset -A opt_args _nix-common-options _arguments \ '(- *)--add[Subscribe to a channel]:Channel URL:_urls::Channel Name:( )'\ '(- *)--remove[Unsubscribe from a channel]:Channel Name:->nix_channels'\ '(- *)--list[List subscribed channels]'\ '(- *)--update[Update and activate channels]:Channel Name:->nix_channels'\ '(- *)--rollback[Revert the previous nix-channel --update]' case $state in nix-channels) local -a channels=(${${(f)"$(nix-channel --list)"}%% *}) _values 'Nix Channels' ${channels} esac 07070100000009000081A4000000000000000000000001650347180000010F000000000000000000000000000000000000002900000000nix-zsh-completions/_nix-collect-garbage#compdef nix-collect-garbage #autoload _nix-common-options _arguments \ '(--delete-old -d)'{--delete-old,-d}'[Delete all old generations of all profiles]'\ '--delete-older-than[Delete generations older than the given time]:Time such as 30d:( )'\ $__nix_dry_run \ 0707010000000A000081A400000000000000000000000165034718000050B6000000000000000000000000000000000000002800000000nix-zsh-completions/_nix-common-options#autoload if [[ $_NIX_SHELL_COMPLETION_LOADED ]]; then # No point in re-defining these functions each time we do a completion return 0 fi # Simple completion function to select a system # List gathered from: https://github.com/NixOS/nixpkgs/blob/master/lib/platforms.nix _nix_systems () { _values 'Systems' \ i686-linux x86_64-linux \ armv5tel-linux armv6l-linux armv7l-linux mips64el-linux \ x86_64-darwin \ i686-freebsd x86_64-freebsd \ i686-openbsd x86_64-openbsd \ i686-netbsd x86_64-netbsd \ i686-cygwin x86_64-cygwin } # Completion function to select an angle-bracket expression from the nix path # Assumptions: No '=' in the actual path components in NIX_PATH # TODO: Complete files in /some/path for expressions like <nixpkgs/pkgs/...> # IMPROVEMENT: Remove '<nixos-config>' since that seems rather useless(?) _nix_shortcuts () { local nix_path=(${(s.:.)NIX_PATH}) local named=(${(M)nix_path:#*=*}) local dirs=(${nix_path:#*=*}) local valid_dir_globs=($^dirs"/*/default.nix(N:h:t)") local valid_dirs=(${~valid_dir_globs}) local names=(${named%%=*}) if [[ "$valid_dirs" || "$names" ]]; then _values shortcuts "<"${^valid_dirs}">" "<"${^names}">" fi } _nix_path() { _alternative \ 'nixpkgs:Nixpkgs:_nix_shortcuts' \ 'path:File Path:_nix_complete_dotnix_files' } _nix_complete_dotnix_files () { _alternative \ "file:Local file:_path_files -g '*.nix(N) *(N-/)'" \ 'shortcuts:Shortcuts:_nix_shortcuts' \ 'channel:Channel:(channel: channel:nixos-13.10 channel:nixos-14.04 channel:nixos-14.04-small channel:nixos-14.12 channel:nixos-14.12-small channel:nixos-15.09 channel:nixos-15.09-small channel:nixos-16.03 channel:nixos-16.03-small channel:nixos-16.09 channel:nixos-16.09-small channel:nixos-17.03 channel:nixos-17.03-small channel:nixos-17.09 channel:nixos-17.09-small channel:nixos-18.03 channel:nixos-18.03-small channel:nixos-18.09 channel:nixos-18.09-small channel:nixos-19.03 channel:nixos-19.03-small channel:nixos-19.09 channel:nixos-19.09-small channel:nixos-20.03 channel:nixos-20.03-small channel:nixos-20.09 channel:nixos-20.09-small channel:nixos-21.05 channel:nixos-21.05-small channel:nixos-21.11 channel:nixos-21.11-small channel:nixos-22.05 channel:nixos-22.05-small channel:nixos-22.11 channel:nixos-22.11-small channel:nixos-unstable channel:nixos-unstable-small channel:nixpkgs-unstable)' \ 'url:URL:(https:// http://)' } # see: https://channels.nixos.org/ _nix_complete_includes () { local cur=${words[$CURRENT]} local -a nixpath=(${(s.:.)NIX_PATH}) local -a path_names local p for p in ${nixpath[*]}; do [[ "$p" == *=* ]] && \ path_names+=(${p%=*}:Path:_nix_complete_dotnix_files) done if [[ $cur == *=* ]]; then path_names+=(${cur%=*}:Path:_nix_complete_dotnix_files) fi if [[ "$path_names" ]]; then _alternative \ "nixpath:nixpath:_values -s = 'Nix path name' $path_names" \ 'file:Path:_path_files -/' else _path_files -/ fi return } _nix_generations () { # List of package names with version numbers stripped setopt extendedglob local -a generations=(${${${(f)"$(nix-env --list-generations)"}## #}/ /:}) _describe -V "Nix Generations" generations } _nix_installed_packages () { # List of package names with version numbers stripped # with the alternative to specify store paths local extra_help=$1 local prefix='-P ./' local current_word=$words[$CURRENT] # When referencing an absolute path we can't prefix with ./ if [[ -z ${current_word:##(/*|\~/*)} && -n $current_word ]]; then prefix="" fi local -a packages=(${${(f)"$(nix-env -q)"}%%-[0-9]*}) _alternative \ "package:packages:_values 'Installed package $extra_help' $packages" \ "file:Store path to package:_files ${prefix}" } # Generate nix code creating the default expression used by 'nix-env -iA' _nix_gen_defexpr () { setopt local_options null_glob local -A result # name -> path map # Search depth first for directories containing 'default.nix' # nix-env -iA prioritize the user's channels in case of name collision # Not sure how collisions in user-created directories are resolved. local -aU initialQueue=($1/channels $1/channels_root $1/*) local -a queue=($initialQueue) while [[ ${#queue} > 0 ]]; do local current=$queue[1] shift queue if [[ -e $current/default.nix ]]; then local name=$(basename $current) if [[ -z $result[$name] ]]; then result[$name]=$current fi else queue=($current/* $queue) fi done local nix_expr="{\n" for name expr_path in ${(kv)result}; do nix_expr+="${name} = import ${expr_path};" nix_expr+="\n" done nix_expr+="}" echo $nix_expr } # Complete attribute names using $1 as the toplevel expression NB: If calling # this function from an action spec you need to prefix it with a space so that # eg. _arguments won't pass it options which it doesn't expect, ie: # `: _nix_attr_paths` _nix_attr_paths () { local cur=${${words[$CURRENT]#(\'|\")}%(\'|\")} # Starting with '.' causes _sep_parts to complain, so exit early. # This also guards against error output when completion './files' with nix. if [[ $cur == .* ]]; then return fi local defexpr=$1 local attr_path="" if [[ $cur == *.* ]]; then attr_path=${cur%.*} fi # attr1.attr3 -> ("attr1" "attr2") local -a paths=(${(s,.,)attr_path}) # Add quotes in a second step to avoid ("") when empty paths=(${${paths/%/\"}/#/\"}) # Auto call any functions in the attribute path. This isn't a language # feature, but done by nix when passing attributes on the command line. local -a result result=($(_nix_eval_stdin <<NIX_FILE let autocall = setOrLambda: if builtins.isFunction setOrLambda then setOrLambda {} else setOrLambda; top = autocall ($defexpr); names = [ ${paths[*]} ]; # Returns attr.name calling it if it's a function reducer = set: name: autocall (builtins.getAttr name set); result = builtins.foldl' reducer top names; #' in if builtins.isAttrs result then builtins.attrNames result else "" NIX_FILE )) # If the eval failed return the error message if [[ $? > 0 ]]; then _message "Eval failed, can't complete (an URL might not be cached): $result" return 1 fi local -a prefix=() if [[ -n $attr_path ]]; then for i in ${=attr_path//./ }; do prefix+=("($i)" .) done fi local package="" _wanted package package "Attribute path" \ _sep_parts $prefix result \. return $? } function _nix_eval_stdin () { setopt local_options pipefail # Build up a modified NIX_PATH using -I and --include local i override="" for ((i=1; i < ${#words[*]}; i++)); do case "${words[i]}" in -I|--include) override+=${override:+:}${words[$((i+1))]} ;; esac done override+=${override:+:}${NIX_PATH} # Resolve channel: syntax while [[ "$override" == *(=|:)channel:* ]]; do local channel=${override#*channel:} channel="channel:"${channel%%:*} local url="https://nixos.org/channels/"${channel:8}"/nixexprs.tar.xz" # Replace the channel with its url override=${override/"$channel"/"$url"} done # Resolve any url to a cache, else we might trigger a blocking download while [[ "$override" == *https://* ]]; do # Find the first url local url=${override#*https://} # Strip everything starting with the first colon url="https://"${url%%:*} local cache=$(_nix_resolve_url "$url") # Replace the url with the cache override=${override/"$url"/"$cache"} done NIX_PATH=$override nix-instantiate --eval - 2>/dev/null | tr '[]"' ' ' return $? } # Generate the top level expression in all the various ways the different # commands expects it to be built. Then generate completions by calling # _nix_attr_paths $defexpr _nix_complete_attr_paths () { local defexpr="" local file=$(_nix_get_file_arg) if [[ "$file" ]]; then # Extract --arg and --argstr into $args local i=1 args="" name="" value="" for ((i=1; i < ${#words[*]}; i++)); do case "${words[$i]}" in --arg) name=${(Q)words[$((i+1))]} value=${(Q)words[$((i+2))]} args+="$name = $value;" i=$((i+2)) ;; --argstr) name=${(Q)words[$((i+1))]} value=${(Q)words[$((i+2))]} args+="$name = \"$value\";" i=$((i+2)) ;; esac done args=${args:+{$args}} local opt defexpr="import $file $args" for opt in $words; do case $opt in --expr|-[^-]#E[^-]#) defexpr="($file) $args" break ;; esac done else if [[ $service == nix-env ]]; then defexpr=$(_nix_gen_defexpr ~/.nix-defexpr) elif [[ $service == nix ]]; then # Extract the channels from NIX_PATH and -I/--include local -a channels=(${(s.:.)NIX_PATH}) # Add -I/--include afterwards, so they will shadow the NIX_PATH channels+=(${(s.:.)opt_args[-I]}) channels+=(${(s.:.)opt_args[--include]}) # Add the names in an associative array to avoid duplicates local -A names local channel name for channel in $channels; do name=${channel%%=*} nix_path=${channel#*=} if [[ $name != $channel ]]; then # Only add paths with a name, not sure how they work names[$name]=1 fi done defexpr=$'{ ' for name in ${(@k)names}; do # nixos-config isn't useful or possible to complete [[ $name == nixos-config ]] && continue defexpr+="$name = import <${name}>; " done defexpr+=' }' fi fi if [[ $defexpr ]]; then _nix_attr_paths $defexpr fi } function _nix_resolve_url () { local url=$1 local version="$($service --version)" local input if [[ "${version##* }" == 1.11.* ]]; then # works for nix 1.11 input="$url" else # works for nix 1.12 input="${url##*/}\0$url" fi local sha sha=$(nix-hash --flat --base32 --type sha256 <(printf "$input")) local cache=${XDG_CACHE_HOME:-~/.cache}/nix/tarballs local link="$cache"/"$sha"-file if [[ -e "$link" ]]; then echo "$cache/$(basename $(readlink $link))-unpacked" fi } function _nix_get_file_arg () { local file="" if [[ "$service" == (nix-env|nix) ]]; then local i # Extract the last seen -f/--file argument for ((i=1; i < ${#words[*]}; i++)); do case "${words[i]}" in --file|-f) file=${words[$((i+1))]} ;; -f\.) # -f. is accepted shorthand for -f . file=. ;; esac done elif [[ $line ]]; then file=$line[1] elif [[ -e shell.nix && $service == nix-shell ]]; then file=shell.nix elif [[ -e default.nix ]]; then file=default.nix fi # Remove one level of shell quoting to make sure we see the same value as # the nix-* program will see. # ($opt_args and $line contain the verbatim string: # eg. given `nix-shell '<nixpkgs>' -A ` $line[1] will be `'<nixpkgs>'` while # nix-shell will see `<nixpkgs>`) file=${(Q)file} if [[ "file" ]]; then # Expand channel: syntax if [[ "$file" == channel:* ]]; then file="https://nixos.org/channels/"${file:8}"/nixexprs.tar.xz" fi if [[ -e $file ]]; then # If the path exist use the absolute path to make sure import will # accept it. # (Otherwise the path is likely a <nixpkgs> notation) file=${file:a} elif [[ "$file" == https://* ]]; then file=$(_nix_resolve_url $file) fi fi print -n -- $file } function _nix_complete_function_arg () { local file=$(_nix_get_file_arg) local func=${file:+import $file} opt local i exclude="" for ((i=1; i < ${#words}; i++)); do case "${words[$i]}" in --expr|-[^-]#E[^-]#) func="$file" ;; --arg|--argstr) # Don't add the name we're currently typing [[ $i == $((CURRENT - 1)) ]] && continue exclude+=${exclude:+|}${words[$((i+1))]} ;; esac done if [[ ! $func ]]; then return fi local -a names names=($(_nix_eval_stdin 2>&1 <<NIX_FILE if builtins.typeOf ($func) == "lambda" then builtins.attrNames (builtins.functionArgs ($func)) else "" NIX_FILE )) if [[ $? > 0 ]]; then _message "Eval failed, can't complete (an URL might not be cached): $names" return 1 fi names=(${names:#(${~exclude})}) [[ "$names" ]] && _values "Argument name" $names } _nix_profiles () { local prefix='-P /nix/var/nix/profiles/ -W /nix/var/nix/profiles/' local cur=$words[$CURRENT] if [[ $cur ]]; then prefix="" fi _path_files -/ ${=prefix} } # Either true or false: useful for completing many Nix options _nix_options_bool () { _values true false } # List gathered from: https://nixos.org/nix/manual/#sec-conf-file # TODO: Complete the value as well, not just the key _nix_options () { # Complete nix options with descriptions local -a nix_options # Strip the header line, remove leading spaces and replace separating # whitespace with ':' nix_options=(${${${${(f)"$(nix --help-config)"}:1:-1}/# /}/ ##/:}) _describe -t nix_options "Option" nix_options } _nix_options_value () { # Print the description of the option we're setting local OPTION=$words[$(($CURRENT - 1))] # Remove lines not starting with " $OPTION " and strip eveything up to the # last two consecutive spaces local description=${${${(f)"$(nix --help-config)"}:#^( $OPTION *)}/* /} local -a values=() case "$description" in Whether*) _values $description true false ;; *) _path_files ;; esac } _nix_run_command_names () { local cmd chan if (( ${+commands[sqlite3]} )); then # Extract the channels from NIX_PATH and -I/--include # Add -I/--include afterwards, so they will shadow the NIX_PATH local -a nix_path=( ${(s.:.)NIX_PATH} ${(s.:.)opt_args[-I]} ${(s.:.)opt_args[--include]} ) # channels: key - channel name, value - path to channel local -A channels for chan in $nix_path; do if [[ $chan = *=* ]]; then # name=path channels[${chan%%=*}]=${chan#*=} else # path to directory with channels for chan in $chan/*(-/); do channels[$chan:t]=$chan done fi done # pkg_cmds is list of commands inside packages # This is an associative array to avoid duplicates. local -A pkg_cmds for chan in ${(k)channels}; do # Extract args with prefix "$chan." local -a pkgs=( "${${(M)words[@]:#"$chan".*}[@]##"$chan".}" ) (( ${#pkgs} )) || continue local db=${channels[$chan]}/programs.sqlite [ -f "$db" ] || continue pkgs=( "'${^pkgs[@]//\'/''}'" ) # SQL-quote local query="SELECT name FROM programs WHERE package IN (${(j:,:)pkgs})" for cmd in $(sqlite3 "$db" "$query"); do pkg_cmds[$cmd]= done done compadd -X 'Package commands' -- ${(k)pkg_cmds} fi _command_names -e -X 'All commands' } ## Common options # Used in: nix-build, nix-env, nix-instantiate, nix-shell, nixops __nix_boilerplate_opts=( '(- *)--help[Print help message and exit]' '(- *)--version[Print version number and exit]' ) # Used in: nix-collect-garbage, nix-env, nix-store, nixops __nix_dry_run='--dry-run[Show what would be done without doing it]' # Used in: nix-collect-garbage, nix-store __nix_gc_common=( '(- --print* --delete)--print-roots[Print roots used by garbage collector]' '(- --print* --delete)--print-live[Print store paths reachable from roots]' '(- --print* --delete)--print-dead[Print store paths not reachable from roots]' '(- --print* --delete)--delete[Garbage collect all dead paths from the store]' ) # Used in: nixos-install, nix_common_opts __nix_search_path_args=( '*-I[add a path to the list of locations used to look up <...> file names]:include path:_nix_complete_includes' ) __nix_repair='--repair[Fix corrupted or missing store paths by redownloading or rebuilding]'; __nix_expr_opts=( '(--expr -E)'{--expr,-E}'[interpret command line args as Nix expressions]' ) # Misc Nix options accepted by nixos-rebuild __nix_common_nixos_rebuild=( $__nix_search_path_args $__nix_repair '(--verbose -v)*'{--verbose,-v}'[Increase verbosity of diagnostic messages]' '(--no-build-output -Q)'{--no-build-output,-Q}'[silence output to stdout and stderr]' '(--max-jobs -j)'{--max-jobs,-j}'[max number of build jobs in parallel]:jobs:' '--cores[threads per job (e.g. -j argument to make)]:cores:' '(--keep-going -k)'{--keep-going,-k}"[keep going until all builds are finished]" '(--keep-failed -K)'{--keep-failed,-K}'[keep failed builds (usually in /tmp)]' '--fallback[If binary download fails, fall back on building from source]' '--show-trace[Print stack trace of evaluation errors]' '*--option[set Nix configuration option]:options:_nix_options:value:_nix_options_value' ) __nix_common_nixos_build_vms=( '*--option[set Nix configuration option]:options:_nix_options:value:_nix_options_value' ) __nix_common_store_opts=( '--add-root[register result as a root of the garbage collector]:path (Hint /nix/var/nix/gcroots):_path_files -/' '--indirect[store gc root outside GC roots directory]' ) # Used in: nix-build, nix-env, nix-instantiate, nix-shell and nix-store __nix_extra_build_opts=( '--max-silent-time[max seconds without getting stdout/err from builder]:Seconds:' '--timeout[max seconds builders should run]:seconds:' '--readonly-mode[do not open Nix database]' '--log-type[configure how output is formatted]:output format:((pretty\:"Default" escapes\:"Indicate nesting with escape codes" flat\:"Remove all nesting"))' ) # Used in: nix-build, nix-env, nix-instantiate, nix-shell __nix_common_opts=( $__nix_common_nixos_rebuild $__nix_args_opts $__nix_extra_build_opts '*--include[add a path to the list of locations used to look up <...> file names]:include path:_nix_complete_includes' '*--arg[argument to pass to the Nix function]:Name:_nix_complete_function_arg:Value: ' '*--argstr[pass a string]:Name:_nix_complete_function_arg:String: ' ) # Options for nix-store --realise, used by nix-build __nix_store_realise_opts=( $__nix_dry_run '--check[rebuild and see if output is deterministic]' ) _NIX_SHELL_COMPLETION_LOADED=1 0707010000000B000081A40000000000000000000000016503471800000250000000000000000000000000000000000000002600000000nix-zsh-completions/_nix-copy-closure#compdef nix-copy-closure #autoload _nix-common-options _arguments \ '(--from)--to[Copy the closure to the remote machine (default)]'\ '(--to)--from[Copy the closure from the remote machine]'\ '--sign[Cryptographically sign to allow sharing between untrusted users on trusted machines]'\ '--gzip[Enable compression of the SSH connection]'\ '--include-outputs[Also copy outputs of store derivations included in the closure]'\ '(--use-substitutes -s)'{--use-substitutes,-s}'[Download files from the binary cache if possible]'\ '1:user@machine:_user_at_host'\ '2:paths:_files' 0707010000000C000081A400000000000000000000000165034718000017BC000000000000000000000000000000000000001D00000000nix-zsh-completions/_nix-env#compdef nix-env #autoload emulate -L zsh setopt extendedglob local context state state_descr line typeset -A opt_args _nix-common-options local -a _1st_arguments _1st_arguments=( {--install,-i}"[Install package]" {--upgrade,-u}"[Upgrade package]" {--uninstall,-e}"[Uninstall package]" --set-flag'[Modify meta attribute of installed package]:Name:->flag_name:Value:->flag_value:*:Packages: _nix_installed_packages' {--query,-q}"[List information about derivations]" {--switch-profile,-S}"[Set the current profile path]" "--list-generations[Print a list of all generations in the active profile]" "--delete-generations[Delete specified generations]" {--switch-generation,-G}"[Activate specified generation]" "--rollback[Switch to the previous generation of active profile]" ) local -a _nix_env_common_opts=( $__nix_common_opts '(--profile -p)'{--profile,-p}'[Specify the profile to use]:Path:_nix_profiles' $__nix_dry_run '--system-filter[Only show derivations matching the specified platform]:system:_nix_systems' ) local -a _nix_env_b=( '(--prebuilt-only -b)'{--prebuilt-only,-b}'[Fail if there is no pre-built binary available]' ) local _nix_env_from_profile _nix_env_from_profile='--from-profile[Fetch store paths from another profile]:Profile:_nix_profiles' # Workaround: # opt_args doesn't record plain options, so we can't use that local expect_attr_paths=false local opt for opt in $words; do case $opt in --attr|-[^-]#A[^-]#) expect_attr_paths=true ;; esac done local -a command_options=() # Look for a main option in the input and setup command_options appropriately for opt in $words; do case "$opt" in --install|-[^-]#i[^-]#) command_options=( $_nix_env_common_opts '(--attr -A)'{--attr,-A}'[Specify packages by attribute path instead of name]' $_nix_env_b $_nix_env_from_profile '(--preserve-installed -P)'{--preserve-installed,-P}'[Do not remove derivations with the same name]' '(--remove-all -r)'{--remove-all,-r}'[Remove all previously installed packages prior to installing]' '*:Package:{if $expect_attr_paths; then _nix_complete_attr_paths; else _nix_installed_packages "(use -A/--attr to access all packages)" fi}') break ;; --upgrade|-[^-]#u[^-]#) command_options=( $_nix_env_common_opts $_nix_env_b $_nix_env_from_profile '(-lt -leq -eq --always)--lt[Upgrade derivations with newer versions (default)]' '(-lt -leq -eq --always)--leq[Upgrade derivations with the same or newer version]' '(-lt -leq -eq --always)--eq[Upgrade derivations with equivalent versions]' '(-lt -leq -eq --always)--always[Upgrade even if version number decreases]' '*:Packages: _nix_installed_packages') break ;; --uninstall|-[^-]#e[^-]#) command_options=( ${_nix_env_common_opts:#'(--attr -A)'*} '*::Packages: _nix_installed_packages') break ;; --set-flag) break ;; --query|-[^-]#q[^-]#) command_options=( $_nix_env_common_opts '(--available -a)'{--available,-a}'[display all installable derivations]' $_nix_env_b '(--status -s)'{--status,-s}'[print status of derivation]' '(--attr-path -P)'{--attr-path,-P}'[print attribute path of derivations]' '--no-name[suppress printing of name attribute]' '(--compare-versions -c)'{--compare-versions,-c}'[compare installed and available version]' '--system[print system attribute]' '--drv-path[print store derivation path]' '--out-path[print output path]' '--description[print description]' '--xml[print output as xml]' '--json[print output as json]' '--meta[Print all meta attributes: only available with --xml]') break ;; --switch-profile|-[^-]#S[^-]#) command_options=($_nix_env_common_opts ':Profile:_nix_profiles') break ;; --delete-generations) command_options=($_nix_env_common_opts '*::Generations:_nix_generations') break ;; --switch-generation|-[^-]#G[^-]#) command_options=($_nix_env_common_opts '::Generations:_nix_generations') break ;; --list-generations) command_options=($_nix_env_common_opts) break ;; --[^-]*|-[^-]#) # Complete common options if the user has started writing something else command_options=($_nix_env_common_opts) ;; esac done # Let _arguments handle the rest, with _1st_arguments being mutually exclusive # under the main_options group _arguments -s $command_options \ '*'{--file,-f}'[Specify Nix expression used to obtain derivations]:Path to file:_nix_path'\ '-f.[evaluate ./default.nix rather than the default]' \ $__nix_boilerplate_opts \ - '(main_options)' \ $_1st_arguments # Handle the --set-flag option case $state in flag_name) local -a _set_flag_attrs=( 'priority:Resolve package name conflicts' 'keep:Prevent package from being upgraded' 'active:Package is symlinked to profile' ) _describe -t commands "Package flag" _set_flag_attrs break ;; flag_value) local flag_name=$words[$(($CURRENT - 1))] case $flag_name in priority) _message "Number, lower priority values denote a higher priority" break ;; keep) _values "TF" true false break ;; active) _values "TF" true false break ;; esac ;; esac 0707010000000D000081A40000000000000000000000016503471800000232000000000000000000000000000000000000001E00000000nix-zsh-completions/_nix-hash#compdef nix-hash #autoload _nix-common-options local -a ig ig=( '--to-base16' '--to-base32' ) _arguments \ '(- *)--to-base16[Convert a base 32 hash to hexadecimal]:Hash:( )' \ '(- *)--to-base32[Convert a hexadecimal hash to base 32]:Hash:( )' \ "($ig)--flat[Print hash of regular files rather than their NAR dump]" \ "($ig)--base32[Print hash in base 32 rather than hexadecimal]" \ "($ig)--truncate[Truncate hashes to 160 bits]" \ "($ig)--type[Hash algorithm to use]:hashAlgo:(md5 sha1 sha256 sha512)" \ "($ig)*:Store Paths:_files" && return 0 0707010000000E000081A400000000000000000000000165034718000001C9000000000000000000000000000000000000002900000000nix-zsh-completions/_nix-install-package#compdef nix-install-package #autoload _nix-common-options _arguments \ '--non-interactive[Do not open a terminal window and do not ask for confirmation]' \ '(--profile -p)'{--profile,-p}'[Profile to install the package into]:Profile:_nix_profiles' \ '--set[Install the package as the profile so that the profile contains nothing else]' \ '(1)--url[URL to download the package file from]:URL:_urls' \ '(--url)1:Package File:_files -g \*.nixpkg' 0707010000000F000081A4000000000000000000000001650347180000039C000000000000000000000000000000000000002500000000nix-zsh-completions/_nix-instantiate#compdef nix-instantiate #autoload _nix-common-options # --no-location: undocumented arg # --repair: undocumented arg _arguments \ - regular \ $__nix_boilerplate_opts \ $__nix_common_opts \ $__nix_common_store_opts \ $__nix_expr_opts \ '*'{--attr,-A}'[build a .drv from file (default: ./default.nix)]:package:_nix_complete_attr_paths' \ '--xml[Print output from --eval as XML]'\ '--json[Print output from --eval as JSON]'\ '--parse[Just parse the input files and print their abstract syntax trees]'\ '--eval[Just parse and evaluate the input files, and print the resulting values]'\ '--strict[Cause --eval to recursively evaluate list elements and attributes]'\ '--read-write-mode[Perform evaluation in read/write mode]'\ '*:File to instantiate (default\: ./default.nix):_nix_path' \ - find-file \ "--find-file[Look up the given files on Nix's search path]:*:Lookup file using <...> logic:"\ 07070100000010000081A40000000000000000000000016503471800000333000000000000000000000000000000000000002600000000nix-zsh-completions/_nix-prefetch-url#compdef nix-prefetch-url #autoload _nix-common-options _resource() { local -a others=( 'https\://:HTTPS URL' 'http\://:HTTP URL' 'mirror\://:Mirror defined in nixpkgs') _alternative \ 'url:Other: _describe "URLS and special options" others' \ 'path:Local path (adds file url prefix):_path_files -P "file://"' } _arguments \ $__nix_search_path_args \ '--unpack[Unpack tarball/zip first]'\ '--print-path[Print the resulting store path]'\ '--type[Use the specified hash algorithm]:Hash Algorithm:(md5 sha1 sha256 sha512)'\ '--name[Override the resulting nix store filename]:nix store filename:'\ '*'{--attr,-A}'[Fetch the src of derivation (eg. mpv.src)]:src (eg. mpv.src): _nix_complete_attr_paths'\ '1:URL or a local nix file:_resource'\ '2::Hash:( )' 07070100000011000081A400000000000000000000000165034718000002C6000000000000000000000000000000000000001E00000000nix-zsh-completions/_nix-push#compdef nix-push #autoload _nix-common-options _arguments \ '--dest[Set the destination directory]:Destination directory:_path_files -/'\ '(--none)--bzip2[Compress NARs using bzip2 instead of xz -9]'\ '(--bzip2)--none[Do not compress NARs]'\ '--force[Overwrite .narinfo files if they already exist]'\ '--link[Hard link files into the destination directory rather than copying]'\ '(--manifest-path)--manifest[Force the generation of a manifest suitable for use by nix-pull]'\ '(--manifest)--manifest-path[Like --manifest, but specify the manifest filename]:Manifest filename:_files'\ '--url-prefix[Specify the prefix URL used in the Manifest]:Prefix URL:_urls'\ '*:Derivation Paths:_files' 07070100000012000081A4000000000000000000000001650347180000044C000000000000000000000000000000000000001F00000000nix-zsh-completions/_nix-shell#compdef nix-shell #autoload _nix-common-options local -a _nix_shell_opts=( '--command[Run a command instead of starting an interactive shell]:Command:_command_names' '--exclude[Do not build any dependencies which match this regex]:Regex:( )' '--pure[Clear the environment before starting the interactive shell]' '--run[Run a command in a non-interactive shell instead of starting an interactive shell]:Command:_command_names' '*'{--attr,-A}"[setup a build shell for package]:package:_nix_complete_attr_paths" ) local norm_arguments='*:Paths:_nix_path' local word for word in $words; do case "$word" in --packages|-[^-]#p[^-]#) norm_arguments='*:Packages: _nix_attr_paths "import <nixpkgs>"' break ;; --expr|-[^-]#E[^-]#) norm_arguments='*:Expression:' ;; esac done _arguments \ $__nix_boilerplate_opts \ $__nix_common_opts \ $__nix_dry_run \ $_nix_shell_opts \ $norm_arguments \ - '(group)' \ $__nix_expr_opts \ {--packages,-p}'[run with packages from <nixpkgs> (override usinge -I)]' 07070100000013000081A400000000000000000000000165034718000014CA000000000000000000000000000000000000001F00000000nix-zsh-completions/_nix-store#compdef nix-store #autoload local context state state_descr line typeset -A opt_args setopt extendedglob _nix-common-options local -a cmd_arguments=( $__nix_boilerplate_opts {--realise,-r}'[Build the specified store paths]' '--serve[provide access to the nix store over stdin/stdout]' '--gc[Perform garbage collection on the Nix store]' '--delete[Delete store paths from the Nix store if it is safe to do so]' {--query,-q}'[Display information about store paths]' '--add[Add paths to the Nix store]' '--verify[Verify the consistency of the Nix database and store]' '--verify-path[Compare the contents of each store path to the hashes stored in the database]' '--repair-path[Attempt to repair the specified paths by redownloading them]' '--dump[Produce a NAR file containing the contents of the given path]' '--restore[Unpack a NAR archive, read from stdin, to the given path]' '--export[Serialize the specified store paths to stdout in a format which can be imported]' '--import[Read searialized store paths from stdin and add them to the Nix store]' '--optimise[Find identical files in the Nix store and hardlink them together to reduce disk usage]' {--read-log,-l}'[Print the build log of the specified store paths]' '--dump-db[Dump Nix database to stdout]' '--load-db[Read a dump of the Nix database]' '--print-env[Print the environment of a derivation as shell code]' '--query-failed-paths[Print out store paths which failed to build]' '--clear-failed-paths[Clear the "failed" state of the given store path]' '--generate-binary-cache-key[generate an Ed25519 key pair to sign build outputs]:key-name::secret-key-file:_files:public-key-file:_files' ) # Common nix-store options local -a common_opts=( '*:Store Paths:_files' $__nix_repair $__nix_common_store_opts $__nix_common_nixos_rebuild $__nix_extra_build_opts ) local -a command_options local opt for opt in $words; do case "$opt" in --realise|-[^-]#r[^-]#) command_options=( $common_opts $__nix_store_realise_opts ) break ;; --serve) command_options=( $common_opts '--write[allow writing to the nix store]' ) break ;; --gc) command_options=( $common_opts $__nix_gc_common '--max-freed[stop the gc after freeing n bytes]:bytes:' ) break ;; --delete) command_options=( $common_opts '--ignore-liveness[Ignore reachability from roots]' ) break ;; --query|-[^-]#q[^-]#) command_options+=( '(--use-output -u)'{--use-output,-u}'[Apply the query to the output path of any store derivations]' '(--force-realise -f)'{--force-realise,-f}'[Realise each argument to the query first]' ) local subopt for subopt in $words; do case "$subopt" in --requisites|-R) command_options+=( $common_opts '--include-outputs[Also include the output paths of store derivations]' ) break ;; --outputs|--references|--referrers|--referrers-closure|--deriver|-d|--graph|--tree|--binding|-b|--hash|--size|--roots) command_options+=($common_opts) break ;; esac done command_options+=( + '(query_subcmds)' '--outputs[Print the output paths of the given store derivations]' {--requisites,-R}'[Print the closure of the given store paths]' '--references[Print immediate dependencies of the given store paths]' '--referrers[Print store paths which refer to these paths]' '--referrers-closure[Print the closure under the referrers relation]' '--deriver[Print the deriver of the store paths]' '--graph[Print the references graph of the store paths in Graphviz format]' '--tree[Print the references graph of the store paths as an ASCII tree]' {--binding,-b}'[Print the value of an attribute of the store derivations]:name:' '--hash[Print the SHA-256 hash of the contents of the store paths]' '--size[Print the size in bytes of the contents of the store paths]' '--roots[Print the garbage collector roots that point to the store paths]' ) break ;; --verify) command_options=( $common_opts '--check-contents[Compute and validate the SHA-256 hash of each store item]' ) break ;; --add|--verify-path|--repair-path|--dump|--restore|--export|--read-log|-l|--print-env) command_options=($common_opts) break ;; --dump-db|--load-db|--query-failed-paths|--optimise) # nothing to complete return ;; --[^-]*|-[^-]#) # Complete common options if the user has started writing something else command_options=($common_opts) ;; esac done _arguments -s \ $command_options \ + '(main_options)' \ $cmd_arguments && return 0 07070100000014000081A40000000000000000000000016503471800001AC5000000000000000000000000000000000000001C00000000nix-zsh-completions/_nixops#compdef nixops #autoload _nix-common-options # List of valid commands local -a _1st_arguments _1st_arguments=( "list:list all known deployments"\ "create:create a new deployment"\ "modify:modify an existing deployment"\ "clone:clone an existing deployment"\ "delete:delete a deployment"\ "info:show the state of the deployment"\ "check:check the state of the machines in the network"\ "set-args:persistently set arguments to the deployment specification"\ "deploy:deploy the network configuration"\ "send-keys:send encryption keys"\ "destroy:destroy all resources in the specified deployment"\ "stop:stop all virtual machines in the network"\ "start:start all virtual machines in the network"\ "reboot:reboot all virtual machines in the network"\ "show-physical:print the physical network expression"\ "ssh:login on the specified machine via SSH"\ "ssh-for-each:execute a command on each machine via SSH"\ "scp:copy files to or from the specified machine via scp"\ "rename:rename machine in network"\ "backup:make snapshots of persistent disks in network (EC2-only)"\ "backup-status:get status of backups"\ "remove-backup:remove a given backup"\ "clean-backups:remove old backups"\ "restore:restore machines based on snapshots of persistent disks in network (EC2-only)"\ "show-option:print the value of a configuration option"\ "list-generations:list previous configurations to which you can roll back"\ "rollback:roll back to a previous configuration"\ "delete-generation:remove a previous configuration"\ "show-console-output:print the machines console output on stdout"\ "dump-nix-paths:dump Nix paths referenced in deployments"\ "export:export the state of a deployment"\ "import:import deployments into the state file"\ "edit:open the deployment specification in \$EDITOR"\ ) # Options valid for every command local -a _nixops_common_arguments _nixops_common_arguments=( '(--state -s)'{--state,-s}'[Path to state file that contains the deployments]:Statefile:_files -g \*.nixops'\ '(--deployment -d)'{--deployment,-d}'[UUID or symbolic name of deployment on which to operate]'\ '--confirm[Automatically confirm "dangerous" actions]'\ '--debug[Turn on debugging output]'\ ) local -a _nixops_include_exclude _nixops_include_exclude=( '--include[Only operate on the specified machines]:Machine Names:_hosts' \ '--exclude[Do not operate on the specified machines]:Machine Names:_hosts' \ ) local -a _nixops_search_path_args _nixops_search_path_args=( '-I[Add path to the Nix expression search path for all future evaluations]:Path:_nix_complete_includes' \ ) _arguments \ $__nix_boilerplate_opts \ '*:: :->subcmds' && return 0 if (( CURRENT==1 )); then _describe -t commands "nixos-container subcommands" _1st_arguments return fi case "$words[1]" in create) _arguments \ $_nixops_common_arguments\ $_nixops_search_path_args \ '*:Nix Expressions:_nix_complete_dotnix_files' ;; modify) _arguments \ $_nixops_common_arguments\ $_nixops_search_path_args \ '(--name -n)'{--name,-n}'[Change the symbolic name]:New Name:( )'\ ;; clone) _arguments \ $_nixops_common_arguments\ '(--name -n)'{--name,-n}'[Symbolic name for the new deployment]'\ ;; delete) _arguments \ $_nixops_common_arguments\ '--all[Delete all deployments in the state file]'\ '--force[]' ;; deploy) _arguments \ $_nixops_common_arguments\ '(--kill-obsolete -k)'{--kill-obsolete,-k}'[Destroy machines no longer listed in the deployment specification]'\ $__nix_dry_run \ $__nix_repair \ '--create-only[Create missing machines only: build nothing and do not touch existing machines]'\ '--build-only[Build the configuration without creating or deploying machines]'\ '--copy-only[Do everything except activate the new configuration]'\ '--check[Check that deployed machines are correctly configured]'\ '--allow-reboot[Allow NixOps to reboot the instance if necessary]'\ '--force-reboot[Reboot the machine to activate the new configuration]'\ '--allow-recreate[Recreate resources that have disappeared]'\ $_nixops_include_exclude \ $_nixops_search_path_args \ '--max-concurrent-copy[Set the maximum concurrent nix-copy-closure processes (Default 5)]:Number:( )' ;; destroy) _arguments \ $_nixops_common_arguments\ '--all[Destroy all deployments]'\ $_nixops_include_exclude \ ;; stop) _arguments \ $_nixops_common_arguments\ $_nixops_include_exclude \ ;; start) _arguments \ $_nixops_common_arguments\ $_nixops_include_exclude \ ;; info) _arguments \ $_nixops_common_arguments\ '--all[Print information about all resources in all known deployments]'\ '--plain[Print in a more easily parsed format]'\ '--no-eval[Do not evaluate the deployment specification]' ;; check) _arguments \ $_nixops_common_arguments\ '--all[Check all machines in all known deployments]' ;; ssh) _arguments \ $_nixops_common_arguments\ '--include-keys[]' ;; ssh-for-each) _arguments \ $_nixops_common_arguments\ '(--parallel -p)'{--parallel,-p}'[Execute the command on each machine in parallel]'\ $_nixops_include_exclude \ ;; reboot) _arguments \ $_nixops_common_arguments\ $_nixops_include_exclude \ '--no-wait[Do not wait until the machines have finished rebooting]' ;; backup) _arguments \ $_nixops_common_arguments\ $_nixops_include_exclude \ ;; restore) _arguments \ $_nixops_common_arguments\ $_nixops_include_exclude \ '--devices[Restore only the persistent disks which are mapped to the specified device names]:Device names:( )'\ '--backup-id[Restore the persistent disks of all machines to a given backup except the ones listed here.]:Backup ids:( )' ;; show-option) _arguments \ $_nixops_common_arguments\ '--xml[Format output as XML]'\ '1:machine:_hosts'\ '2:option:( )' ;; set-args) _arguments \ $_nixops_common_arguments\ '--arg[Set the function argument]:Name:( ):Value:( )'\ '--argstr[Like --arg but the value is a string]:Name:( ):Value:( )'\ '--unset[Remove a previously set function argument]:Name:( )' ;; show-console-output) _arguments \ $_nixops_common_arguments\ '1:machine:_hosts' ;; export) _arguments \ $_nixops_common_arguments\ '--all[Apply to all deployments]' ;; import) _arguments \ $_nixops_common_arguments\ '--include-keys[]' ;; *) _arguments \ $_nixops_common_arguments\ ;; esac 07070100000015000081A4000000000000000000000001650347180000011A000000000000000000000000000000000000002500000000nix-zsh-completions/_nixos-build-vms#compdef nixos-build-vms #autoload _nix-common-options _arguments \ $__nix_common_nixos_build_vms \ '--show-trace[Show a trace of the output]'\ "--no-out-link[Do not create a 'result' symlink]"\ "--help[Show help]"\ '1:Network Nix Expression:_nix_complete_dotnix_files' 07070100000016000081A40000000000000000000000016503471800000802000000000000000000000000000000000000002500000000nix-zsh-completions/_nixos-container#compdef nixos-container #autoload _nix-common-options _containers () { containers=($(nixos-container list)) _wanted containers expl 'containers' compadd -a containers } local -a _1st_arguments _1st_arguments=( 'list:Show list of containers'\ 'create:Create a container'\ 'destroy:Destroy a container'\ 'start:Start a container'\ 'stop:Stop a container'\ 'status:Get status of a container'\ 'update:Update container'\ 'login:Login to a container'\ 'root-login:Login to a container as root (no password needed)'\ 'run:Run a container'\ 'show-ip:Display the IP of a container'\ 'show-host-key:Display the host key of a container' ) _arguments \ '(- 1 *)--help[Display help]'\ '*:: :->subcmds' && return 0 if (( CURRENT==1 )); then _describe -t commands "nixos-container subcommands" _1st_arguments return fi local _container_name='1:Container Name:_containers'; local _container_config='--config[Config]:Config:( )'; local _container_file='--config-file[Path to the container config file]:Path:_files'; case "$words[1]" in create) _arguments\ $_container_name\ $_container_config\ $_container_file\ '--system-path[System path]:Path:_files'\ '--ensure-unique-name[Avoid name conflicts with other containers]'\ '--auto-start[Start the container immediately]'\ '--nixos-path[Path to <nixpkgs/nixos>]:Path:_files'\ '--host-address[Host IP of the veth interface]:host address:'\ '--local-address[IPv4 address assined to the interface in the container]:local address:'\ '--bridge[Put the host-side of the veth-pair into the named bridge]:Bridge interface'\ '--port[Port forwarding]:port forwarding' ;; run) # TODO: There are a few more arguments in this case _arguments\ $_container_name\ ;; update) _arguments\ $_container_name\ $_container_config\ $_container_file ;; destroy|start|stop|status|login|root-login|show-ip|show-host-key) _arguments\ $_container_name ;; esac 07070100000017000081A40000000000000000000000016503471800000202000000000000000000000000000000000000002B00000000nix-zsh-completions/_nixos-generate-config#compdef nixos-generate-config #autoload _nix-common-options _arguments \ '--force[Overwrite /etc/nixos/configuration.nix if it exists]:'\ '--root[Directory to treat as root of filesystem]:Root directory:_path_files -/'\ '--dir[Directory to write configuration files to (Default /etc/nixos)]:Output directory:_path_files -/'\ '--no-filesystems[Omit file system information from hardware configuration]'\ '--show-hardware-config[Print hardware configuration to stdout without writing anything to disk]' 07070100000018000081A4000000000000000000000001650347180000013F000000000000000000000000000000000000002300000000nix-zsh-completions/_nixos-install#compdef nixos-install #autoload _nix-common-options _arguments \ $__nix_search_path_args \ '--root[Treat the given directory as the root of the NixOS installation]:Installation Root:_path_files -/'\ '--show-trace[Print a stack trace in case of evaluation errors]'\ '--chroot[Chroot into given installation]' 07070100000019000081A4000000000000000000000001650347180000024A000000000000000000000000000000000000002200000000nix-zsh-completions/_nixos-option#compdef nixos-option #autoload _nix-common-options # import _nix_attr_paths etc. _nixos-option-opts() { local mods= if [[ -n "$NIX_PATH" && "$NIX_PATH" =~ "nixos-config=" ]]; then mods="(import <nixos-config>)" fi local options=' with import <nixpkgs/lib>; (evalModules { modules = import <nixpkgs/nixos/modules/module-list.nix> ++ [ '"$mods"' ]; }).config ' _nix_attr_paths $options } _arguments \ $__nix_search_path_args \ '--all[Print the values of all options.]' \ ':NixOS module options:_nixos-option-opts' 0707010000001A000081A400000000000000000000000165034718000004FD000000000000000000000000000000000000002300000000nix-zsh-completions/_nixos-rebuild#compdef nixos-rebuild #autoload _nix-common-options local -a _1st_arguments _1st_arguments=( 'switch:Build, activate, and update boot default' 'boot:Build and update boot default without activating' 'test:Build and activate without updating boot default' 'build:Build without activating or updating boot default' 'dry-build:Show what store paths would be built or downloaded without building' 'dry-activate:Build and show what changes would be performed by the activation' 'build-vm:Create a script which starts a VM with the built configuration' 'build-vm-with-bootloader:Like build-vm, but boot using regular boot loader' ) _arguments \ $__nix_common_nixos_rebuild \ '--upgrade[Fetch the latest version of NixOS from the NixOS channel]'\ '--install-bootloader[(Re)install bootloader on the configured device]'\ "--no-build-nix[Don't build Nix package manager]"\ '--fast[Equivalent to --no-build-nix --show-trace]'\ '--rollback[Roll back to the previous configuration]'\ '(--profile-name -p)'{--profile-name,-p}'[Profile to use to track current and previous system configurations]:Profile:_nix_profiles'\ '1:: :->subcmds' && return 0 case $state in subcmds) _describe -t commands "nixos-rebuild subcommands" _1st_arguments ;; esac 0707010000001B000081A4000000000000000000000001650347180000008C000000000000000000000000000000000000002300000000nix-zsh-completions/_nixos-version#compdef nixos-version #autoload _nix-common-options _arguments \ '(- *)'{--hash,--revision}'[Print only the git hash of the channel]'\ 0707010000001C000081A40000000000000000000000016503471800000043000000000000000000000000000000000000001D00000000nix-zsh-completions/init.zsh # Source module files. source "${0:h}/nix.plugin.zsh" || return 1 0707010000001D000081A40000000000000000000000016503471800000352000000000000000000000000000000000000003300000000nix-zsh-completions/nix-zsh-completions.plugin.zsh# Nix Install alias ni='nix-env -iA' # Nix Search alias ns='nix-env -qaP' function prompt_nix_shell_precmd { if [[ -n ${IN_NIX_SHELL} && ${IN_NIX_SHELL} != "0" || ${IN_NIX_RUN} && ${IN_NIX_RUN} != "0" ]]; then if [[ -n ${IN_WHICH_NIX_SHELL} ]] then NIX_SHELL_NAME=": ${IN_WHICH_NIX_SHELL}" fi if [[ -n ${IN_NIX_SHELL} && ${IN_NIX_SHELL} != "0" ]]; then NAME="nix-shell" else NAME="nix-run" fi NIX_PROMPT="%F{8}[%F{3}${NAME}${NIX_SHELL_NAME}%F{8}]%f" if [[ $PROMPT != *"$NIX_PROMPT"* ]] then PROMPT="$NIX_PROMPT $PROMPT" fi fi } function prompt_nix_shell_setup { autoload -Uz add-zsh-hook add-zsh-hook precmd prompt_nix_shell_precmd } # Add this to your zshrc if you want the prompt prefixed with `[nix-shell]` # when you're in a nix-shell environment. # prompt_nix_shell_setup "$@" 0707010000001E0000A1FF00000000000000000000000164BB456B0000001E000000000000000000000000000000000000002300000000nix-zsh-completions/nix.plugin.zshnix-zsh-completions.plugin.zsh07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!121 blocks
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor