Klimi's new dotfiles with stow.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

37 行
1.0 KiB

  1. ;;; nix-log.el -- run nix commands in Emacs -*- lexical-binding: t -*-
  2. ;; Author: Matthew Bauer <mjbauer95@gmail.com>
  3. ;; Homepage: https://github.com/NixOS/nix-mode
  4. ;; Keywords: nix
  5. ;; Version: 1.4.0
  6. ;; This file is NOT part of GNU Emacs.
  7. ;;; Commentary:
  8. ;;; Code:
  9. (require 'nix)
  10. (require 'nix-search)
  11. (require 'nix-instantiate)
  12. (defun nix-log (file attr)
  13. "Open the nix log.
  14. FILE nix file to parse.
  15. ATTR attribute to load the log of."
  16. (interactive (list (nix-read-file) nil))
  17. (unless attr (setq attr (nix-read-attr file)))
  18. (let* ((drv-file (nix-instantiate file attr))
  19. (drv-name (progn
  20. (string-match (format "^%s/\\(.*\\)$" nix-store-dir) drv-file)
  21. (match-string 1 drv-file)))
  22. (log-file (format "%s/log/nix/drvs/%s/%s.bz2"
  23. nix-state-dir
  24. (substring drv-name 0 2) drv-name)))
  25. (if (file-exists-p log-file)
  26. (find-file log-file)
  27. (error "No log is available for derivation"))))
  28. (provide 'nix-log)
  29. ;;; nix-log.el ends here