| nixos-options | helm-nixos-options | ivy-nixos-options | company-nixos-options | nix-sandbox |
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
The description of the option is shown in the minibuffer
If you want more information, there is a detailed buffer when you press return
There are also other actions like inserting the current match into the buffer
Use this if you don’t want the rather heavy helm dependency.
The function ivy-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") 'ivy-nixos-options)
(setq ivy-nixos-options-default 1)
; defines what function is being called when pressing return. I like to have it set to 2
; All of the actions can always be called when pressing M-o
; 1 = show the docs buffer (default)
; 2 = insert the string
; 3 = only show the description of the commandIt looks like this
If you want more information, there is a detailed buffer when you press return
There are also other actions like inserting the current match into the buffer.
The builtin help menu from ivy (display with M-o) shows all possible options. e.g. M-o i will insert the option
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.
Utility functions to work with nix sandboxes.
nix-shell-commandcomposes command that can be executed in the given sandboxnix-shellexecutes a command in the given sandboxnix-compilecompiles a program in the given sandboxnix-find-sandboxsearches from the given path upwards until it finds ashell.nixordefault.nixfile.nix-current-sandboxsearches for a sandbox file starting from the current working directory.nix-executable-finda replacement for the built-inexecutable-find. The function searches in the given sandbox for executables.
With this configuration flycheck can find executables of checkers that would be only accessible via nix-shell:
(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)))Add these lines to your configuration to allow haskell-mode to look for ghc in the current sandbox.
(setq haskell-process-wrapper-function
(lambda (args) (apply 'nix-shell-command (nix-current-sandbox) args)))





