emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode 097b7bb992 257/500: Add nix-build.el


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 097b7bb992 257/500: Add nix-build.el
Date: Sat, 29 Jan 2022 08:27:11 -0500 (EST)

branch: elpa/nix-mode
commit 097b7bb992077888960ebfd2d9092863d3821816
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>

    Add nix-build.el
---
 nix-build.el | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/nix-build.el b/nix-build.el
new file mode 100644
index 0000000000..0bea996f4a
--- /dev/null
+++ b/nix-build.el
@@ -0,0 +1,33 @@
+;;; nix.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:
+
+;; To use this just run:
+
+;; M-x RET nix-shell RET
+
+;; This will give you some
+
+;;; Code:
+
+(require 'nix)
+(require 'nix-search)
+
+(defun nix-build (&optional attr)
+  "Run nix-build in a compilation buffer."
+  (interactive (list (nix-search-read-attr "./.")))
+  (setq compile-command (format "%s -A '%s'" nix-build-executable attr))
+  (setq-default compilation-directory default-directory)
+  (compilation-start compile-command nil
+                    (apply-partially (lambda (attr _)
+                                       (format "*nix-build*<%s>" attr))
+                                     attr)))
+
+(provide 'nix-build)
+;;; nix-build.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]