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

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

[nongnu] elpa/nix-mode 0181c35a4f 202/500: Add nix-unpack command.


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 0181c35a4f 202/500: Add nix-unpack command.
Date: Sat, 29 Jan 2022 08:27:06 -0500 (EST)

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

    Add nix-unpack command.
---
 nix-shell.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nix-shell.el b/nix-shell.el
index 0cd1108496..e500692f68 100644
--- a/nix-shell.el
+++ b/nix-shell.el
@@ -43,5 +43,17 @@ ATTRIBUTE attribute name in nixpkgs to use."
   (term-char-mode)
   (switch-to-buffer "*nix-shell*"))
 
+;;;###autoload
+(defun nix-unpack (path attribute)
+  "Get source from a Nix derivation.
+
+PATH used for base of Nix expresions.
+
+ATTRIBUTE from PATH to get Nix expressions from."
+  (interactive (list (read-string "Nix path: " "<nixpkgs>")
+                                        (read-string "Nix attribute name: ")))
+  (async-shell-command (format "%s '%s' -A '%s' --run unpackPhase"
+                                                          nix-shell-executable 
dir attribute)))
+
 (provide 'nix-shell)
 ;;; nix-shell.el ends here



reply via email to

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