diff options
author | William Carroll <wpcarro@gmail.com> | 2018-09-10T18·51-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2018-09-10T18·53-0400 |
commit | 17ee0e400bef47c371afcae76037f9ea6a44ad13 (patch) | |
tree | 0e5efee6f00e402890e91f3eceb4b29408a498b6 /configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el | |
parent | 8b2fadf4776b7ddb4a67b4bc8ff6463770e56028 (diff) |
Support Vim, Tmux, Emacs with Stow
After moving off of Meta, Dotfiles has a greater responsibility to manage configs. Vim, Tmux, and Emacs are now within Stow's purview.
Diffstat (limited to 'configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el')
-rw-r--r-- | configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el b/configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el new file mode 100644 index 000000000000..192ab3170e87 --- /dev/null +++ b/configs/shared/emacs/.emacs.d/elpa/nix-mode-20180822.214/nix-log.el @@ -0,0 +1,36 @@ +;;; nix-log.el -- run nix commands in Emacs -*- lexical-binding: t -*- + +;; Author: Matthew Bauer <mjbauer95@gmail.com> +;; Homepage: https://github.com/NixOS/nix-mode +;; Keywords: nix + +;; This file is NOT part of GNU Emacs. + +;;; Commentary: + +;;; Code: + +(require 'nix) +(require 'nix-search) +(require 'nix-instantiate) + +(defun nix-log (file attr) + "Open the nix log. +FILE nix file to parse. +ATTR attribute to load the log of." + (interactive (list (nix-read-file) nil)) + (unless attr (setq attr (nix-read-attr file))) + + (let* ((drv-file (nix-instantiate file attr)) + (drv-name (progn + (string-match (format "^%s/\\(.*\\)$" nix-store-dir) drv-file) + (match-string 1 drv-file))) + (log-file (format "%s/log/nix/drvs/%s/%s.bz2" + nix-state-dir + (substring drv-name 0 2) drv-name))) + (if (file-exists-p log-file) + (find-file log-file) + (error "No log is available for derivation")))) + +(provide 'nix-log) +;;; nix-log.el ends here |