Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanup nix-build.el
  • Loading branch information
matthewbauer committed Aug 22, 2018
1 parent 295cd67 commit 0c2807f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions nix-build.el
@@ -1,4 +1,4 @@
;;; nix.el -- run nix commands in Emacs -*- lexical-binding: t -*-
;;; nix-build.el -- run nix commands in Emacs -*- lexical-binding: t -*-

;; Author: Matthew Bauer <mjbauer95@gmail.com>
;; Homepage: https://github.com/NixOS/nix-mode
Expand All @@ -8,21 +8,20 @@

;;; 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))
(defun nix-build (&optional file attr)
"Run nix-build in a compilation buffer.
FILE the file to parse.
ATTR the attribute to build."
(interactive (list (nix-read-file) nil))
(unless attr (setq attr (nix-read-attr file)))

(setq compile-command (format "%s %s -A '%s'" nix-build-executable
file attr))
(setq-default compilation-directory default-directory)
(compilation-start compile-command nil
(apply-partially (lambda (attr _)
Expand Down

0 comments on commit 0c2807f

Please sign in to comment.