Klimi's new dotfiles with stow.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

37 líneas
1.0 KiB

hace 5 años
  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