[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el |
Date: |
Sat, 29 Jan 2022 08:27:10 -0500 (EST) |
branch: elpa/nix-mode
commit 1be3ca4666580f8bea459fa89658d20df2328e9e
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Clean up nix-shell.el
---
nix-shell.el | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/nix-shell.el b/nix-shell.el
index 227da5a9a5..61420a0bad 100644
--- a/nix-shell.el
+++ b/nix-shell.el
@@ -19,6 +19,7 @@
(require 'nix)
(require 'nix-instantiate)
(require 'nix-store)
+(require 'nix-search)
(defgroup nix-shell nil
"All nix-shell options."
@@ -68,15 +69,21 @@ ATTR is the attribute to unpack."
(if nix-attr nix-attr (nix-search-read-attr "<nixpkgs>"))))
(nix-shell--run-phase "unpack" file attr))
+(defun nix-shell--find-file ()
+ (cond
+ (nix-file nix-file)
+ ((file-exists-p "shell.nix") "shell.nix")
+ ((file-exists-p "default.nix") "default.nix")
+ (t (read-file-name "Nix file: "))))
+
;;;###autoload
(defun nix-shell-configure (file attr)
"Run Nix’s configurePhase.
FILE is the file to configure from.
ATTR is the attribute to configure."
(interactive
- (list
- (if nix-file nix-file "<nixpkgs>")
- (if nix-attr nix-attr (nix-search-read-attr "<nixpkgs>"))))
+ (list (nix-shell--find-file)
+ (if nix-attr nix-attr (nix-search-read-attr "<nixpkgs>"))))
(nix-shell--run-phase "configure" file attr))
;;;###autoload
@@ -85,9 +92,8 @@ ATTR is the attribute to configure."
FILE is the file to build from.
ATTR is the attribute to build."
(interactive
- (list
- (if nix-file nix-file "<nixpkgs>")
- (if nix-attr nix-attr (nix-search-read-attr "<nixpkgs>"))))
+ (list (nix-shell--find-file)
+ (if nix-attr nix-attr (nix-search-read-attr "<nixpkgs>"))))
(nix-shell--run-phase "build" file attr))
(defun nix-shell--run-phase (phase file attr)
- [nongnu] elpa/nix-mode 8a65262d37 200/500: Remove smartparens feature detection, (continued)
- [nongnu] elpa/nix-mode 8a65262d37 200/500: Remove smartparens feature detection, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode cc23fd6a0e 206/500: Default to indent-relative, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9f4f5d5860 204/500: Checkdoc of elisp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode be7184ffcd 209/500: use tab-width instead of hardcoded '2', ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a8b334c75 212/500: Merge pull request #42 from serokell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b8aed79f89 211/500: No need to indent on = and ; (ruins your day), ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 81680dd7ac 213/500: nix-repl.el: make it work with newer nix repl command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a8af6e9203 218/500: Find nix executables at start, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode d6286ce43b 235/500: Add pcomplete support to nix.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode dd49386cc7 240/500: Remove global-nix-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1be3ca4666 245/500: Clean up nix-shell.el,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 4ef5d77214 246/500: Add user manual, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2bc99a4542 247/500: Add new CHANGELOG entry., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 14d1bbb936 248/500: Delete dir-locals.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ae2c44c160 250/500: Add nix-shell-haskell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c462eb400b 251/500: Add alias for nix-repl-show, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 47cdb44e2e 255/500: Improve indentation robustness, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1c772ad539 253/500: Remove recommended config, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 295cd6729b 261/500: Add nix-edit.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fde8c8e38c 268/500: Merge pull request #48 from dustinlacewell/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 90ac0a74b2 273/500: Merge pull request #55 from teozkr/issue-54, ELPA Syncer, 2022/01/29