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

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

[nongnu] elpa/nix-mode 6573b1d70e 145/500: Add nix-shell.el


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 6573b1d70e 145/500: Add nix-shell.el
Date: Sat, 29 Jan 2022 08:26:57 -0500 (EST)

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

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

diff --git a/nix-shell.el b/nix-shell.el
new file mode 100644
index 0000000000..4ce523f402
--- /dev/null
+++ b/nix-shell.el
@@ -0,0 +1,33 @@
+;;; nix-shell.el -- run nix-shell in Emacs -*- lexical-binding: t -*-
+
+;; Author: Matthew Bauer <mjbauer95@gmail.com>
+;; Homepage: https://github.com/matthewbauer/nix-mode
+;; Keywords: nix
+
+;; This file is NOT part of GNU Emacs.
+
+;;; Commentary:
+
+;;; Code:
+
+
+(require 'term)
+
+(defcustom nix-shell-executable "nix-shell"
+  "Location of nix-shell executable."
+  :group 'nix-mode)
+
+;;;###autoload
+(defun nix-shell (attribute)
+  "Run nix-shell in a terminal.
+
+ATTRIBUTE attribute name in nixpkgs to use."
+  (interactive (list (read-from-minibuffer "Attribute name: ")))
+  (set-buffer (make-term "nix-shell" nix-shell-executable nil
+                         "<nixpkgs>" "-A" attribute))
+  (term-mode)
+  (term-char-mode)
+  (switch-to-buffer "*nix-shell*"))
+
+(provide 'nix-shell)
+;;; nix-shell.el ends here



reply via email to

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