Giter Club home page Giter Club logo

any-nix-shell's Introduction

any-nix-shell

fish and zsh support for the nix shell and nix-shell environments of the Nix package manager.

Features:

  • When entering a nix shell or nix-shell environment, the shell stays the same.
  • Inside those environments, your prompt prints the loaded packages to the right.
  • Alternatively, print that information by executing: nix-shell-info
  • nix-shell --command or the like still execute inside bash, such that scripts don't break.

Installation

any-nix-shell can currently be installed from the official nixos-unstable channel (Link 1, Link 2). If you don't know how to do that, you can alternatively execute

nix-env -i any-nix-shell -f https://github.com/NixOS/nixpkgs/archive/master.tar.gz

which installs any-nix-shell into your user environment.

Enabling

In the following we describe how to enable the any-nix-shell plugin for your user. This differs slightly between fish and zsh.

fish

Add the following to your ~/.config/fish/config.fish. Create it if it doesn't exist.

any-nix-shell fish --info-right | source

zsh

Add the following to your ~/.zshrc. Create it if it doesn't exist.

any-nix-shell zsh --info-right | source /dev/stdin

System-wide enabling on NixOS

Alternatively the any-nix-shell plugin can be enabled system-wide. This enables it for every user. To do so, add the following to your configuration (/etc/nixos/configuration.nix).

fish

  programs.fish.enable = true;
  programs.fish.promptInit = ''
    any-nix-shell fish --info-right | source
  '';

zsh

  programs.zsh.enable = true;
  programs.zsh.promptInit = ''
    any-nix-shell zsh --info-right | source /dev/stdin
  '';

zsh with home-manager

  programs.zsh.enable = true;
  programs.zsh.initExtra = ''
    any-nix-shell zsh --info-right | source /dev/stdin
  '';

Customization

The any-nix-shell command (which is used for enabling the plugin in a specific shell) optionally takes any of the following flags:

Flag Description
--info-right While in a nix shell or nix-shell environment, display information about the loaded packages at the right.

any-nix-shell's People

Contributors

haslersn avatar nrdxp avatar savoisn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.