Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
849 B

преди 5 години
  1. ;;; nix-build.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. ;; This file is NOT part of GNU Emacs.
  6. ;;; Commentary:
  7. ;;; Code:
  8. (require 'nix)
  9. (require 'nix-search)
  10. (defun nix-build (&optional file attr)
  11. "Run nix-build in a compilation buffer.
  12. FILE the file to parse.
  13. ATTR the attribute to build."
  14. (interactive (list (nix-read-file) nil))
  15. (unless attr (setq attr (nix-read-attr file)))
  16. (setq compile-command (format "%s %s -A '%s'" nix-build-executable
  17. file attr))
  18. (setq-default compilation-directory default-directory)
  19. (compilation-start compile-command nil
  20. (apply-partially (lambda (attr _)
  21. (format "*nix-build*<%s>" attr))
  22. attr)))
  23. (provide 'nix-build)
  24. ;;; nix-build.el ends here