Subject: [bug#28060] [PATCH] gnu: Add emacs-nixos-mode.

From: Oleg Pykhalov <[email-masked]>
Date: Sat, 12 Aug 2017 19:56:00 +0300

Hello Arun,

thank you for supporting this patch.

Arun Isaac <[email-masked]> writes:

> Thanks for the patch!
> Oleg Pykhalov writes:

…

>> +    (arguments
>> +     `(#:phases
>> +       (modify-phases %standard-phases
>> +         (add-after 'unpack 'chdir-elisp
>> +           (lambda _
>> +             (chdir "misc/emacs"))))))
>
> It is kinda obvious, but do add a short comment explaining why we are
> changing directory.

DONE.

>> +    (synopsis "Emacs major mode for editing Nix expressions")
>> +    (description "@code{nixos-mode} provides an Emacs major mode for editing
>> +Nix expressions.")
>
> Could you add the following line to the description?
>
> "It supports syntax highlighting, indenting and refilling of comments."
>
> I have taken the above sentence from
> https://github.com/NixOS/nix/blob/master/misc/emacs/README

DONE.

>> +    (license license:gpl3+)))
>
> Nix is under the LGPL 2.1 license. So, nix-mode should also be under the
> same license, right?

DONE.

> Could you send an updated patch? Thanks!

>From 796f6a09c9464812f85c77641473ac9c85ac9654 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <[email-masked]>
Date: Sat, 12 Aug 2017 09:48:53 +0300
Subject: [PATCH] gnu: Add emacs-nixos-mode.

* gnu/packages/emacs.scm (emacs-nixos-mode): New variable.
---
 gnu/packages/emacs.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index bb5d2349f..cdee59858 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -5331,3 +5331,31 @@ enables you to easily define search engines, bind them to keybindings, and
 query them from the comfort of your editor.")
     (home-page "https://github.com/hrs/engine-mode")
     (license license:gpl3+)))
+
+(define-public emacs-nixos-mode
+  (package
+    (name "emacs-nixos-mode")
+    (version "1.11.13")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/NixOS/nix/archive/"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "12110drl51r9bi45ql865jwvax1gladb5hfpwk0vi5bjybns6c9b"))))
+    (build-system emacs-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chdir-elisp
+           ;; Elisp directory is not in root of the source.
+           (lambda _
+             (chdir "misc/emacs"))))))
+    (synopsis "Emacs major mode for editing Nix expressions")
+    (description "@code{nixos-mode} provides an Emacs major mode for editing
+Nix expressions.  It supports syntax highlighting, indenting and refilling of
+comments.")
+    (home-page "https://github.com/NixOS/nix")
+    (license license:lgpl2.1+)))
-- 
2.14.1

-- 
Best regards,

Oleg.