Code Monkey home page Code Monkey logo

nix-emacs's Introduction

Nix Options โ€“ A set of useful Emacs modes and functions for users of Nix and Nix OS.

nixos-optionshelm-nixos-optionscompany-nixos-options
http://melpa.org/packages/nixos-options-badge.svghttp://melpa.org/packages/helm-nixos-options-badge.svghttp://melpa.org/packages/company-nixos-options-badge.svg

https://badges.gitter.im/Join Chat.svg https://badge.waffle.io/travisbhartwell/nix-emacs.svg

Usage

helm-nixos-options

The function helm-nixos-options is the one that you want to bind. You are free to choose where and if you want it global you can have this.

(global-set-key (kbd "C-c C-S-n") 'helm-nixos-options)

It looks like this img/helm-nixos-options-candidates.png

The description of the option is shown in the minibuffer

If you want more information, there is a detailed buffer when you press return

img/helm-nixos-options-doc-buffer.png

There are also other actions like inserting the current match into the buffer

img/helm-nixos-options.gif

company-nixos-options

Add company-nixos-options to allowed company-mode backends list

(add-to-list 'company-backends 'company-nixos-options)

For now it shows the documentation of the option in a popup-buffer.

img/company-nixos-options.gif

nixos-sandbox

Contains utility functions to work with nix-shell sandboxes.

  • nix-shell-command to compose a nix-shell command string that can be passed to the command-line
  • nix-shell that directly executes a command in the given sandbox
  • nix-find-sandbox searches from the given path upwards until it finds a *.nix file.
  • nix-current-sandbox searches from the current working directroy upwards until it finds a *.nix file
  • nix-executable-find, a replacement for the built-in executable-find. It searches in the given sandbox for executable.

Flycheck

With these utility functions, flycheck can easily be used with Nix:

(setq flycheck-command-wrapper-function
        (lambda (command) (apply 'nix-shell-command (nix-current-sandbox) command))
      flycheck-executable-find
        (lambda (cmd) (nix-executable-find (nix-current-sandbox) cmd)))

Haskell Mode

To use haskell-mode together with Nix, add these lines to your configuration:

(setq haskell-process-wrapper-function
        (lambda (args) (apply 'nix-shell-command (nix-current-sandbox) args)))

nix-emacs's People

Contributors

travisbhartwell avatar cestdiego avatar svenkeidel avatar markus1189 avatar mdorman avatar purcell avatar syohex avatar jgertm avatar syl20bnr avatar

Watchers

James Cloos avatar Andika Demas Riyandi 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.