Giter Site home page Giter Site logo

nixos / nix-mode Goto Github PK

View Code? Open in Web Editor NEW
290.0 18.0 72.0 561 KB

An Emacs major mode for editing Nix expressions.

License: GNU Lesser General Public License v2.1

Emacs Lisp 84.46% Makefile 1.20% Nix 14.35%
nix emacs major-mode nixpkgs syntax-highlighting

nix-mode's Introduction

nix-mode

MELPA MELPA Stable Build Status

An Emacs major mode for editing Nix expressions. There is also a manual available at nix-mode.org.

Submodes

A quick list of what is provided.

nix-mode.el

This is the main usage of nix-mode. This provides basic handling of .nix files. Syntax highlighting and indentation support using SMIE are provided. nix-mode can be used with the following snippet:

(require 'nix-mode)
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))

or with use-package:

(use-package nix-mode
  :mode "\\.nix\\'")

nix.el

nix.el contains some miscellaneous tools for Nix developers. Interactive functions include:

  • nix-unpack - unpack source of a Nix attribute.

    To use this just type:

    M-x nix-unpack

    Followed by your Nix path & attribute path.

  • nix-build - build a Nix derivation.

    This is meant to work similarly to M-x compile. It will use your current directory & build it if there is a default.nix there.

nix.el also provides some basic functions for interfacing with Nix. Some variables are provided to point to the Nix binaries that can be used in Lisp code:

  • nix-executable
  • nix-build-executable
  • nix-instantiate-executable
  • nix-store-executable
  • nix-shell-executable

Other useful functions for Lisp scripts are provided:

  • nix-system - Get the current system, detected by Nix

nix-flake.el

nix-flake.el provides support for flake commands. These commands are experimental as of Nix 2.4.

It uses transient.el to provide a magit-like interface. To run a command on the current flake, type:

M-x nix-flake

You can also initialize a flake from a template:

M-x nix-flake-init

nix-repl.el

nix-repl.el has two purposes.

First, it provides an interface for completion, used by nix-company.el.

Second, it provides an interactive function to open a repl. You can open this with:

M-x nix-repl

nix-store.el

This file provides a command M-x nix-store-show-path. The command displays an overview of a store path. The information it shows is the realisation status, the hash and the size of the store path. Also it shows lists of derivers, references, referrers and requisites of the respective path.

You can change the order in which that information is shown. See the documentation of the function nix-store-show-path for more information.

When viewing a store buffer, the command M-x nix-store-show-log opens a local log file associated with a derivation.

nix-prettify-mode.el

When nix-prettify-mode is enabled, hash-parts of the Nix store file names are prettified, i.e. displayed as nix-prettify-char character (โ€ฆ by default.).

This is based on a similar mode for Guix: Prettify Mode (Emacs-Guix Reference Manual).

Origins

This repository is based off of the nix-mode.el file originally located in the Nix repository at misc/emacs/nix-mode.el. Please see the CHANGELOG file for a list of changes.

Other Emacs packages

@shlevy has an excellent package for integrating nix-shell into emacs. It is available at shlevy/nix-buffer.

@travisbhartwell also has some package dealing with Nix. They are available at travisbhartwell/nix-emacs.

nix-mode's People

Contributors

akirak avatar bcc32 avatar conao3 avatar dependabot[bot] avatar dustinlacewell avatar eqyiel avatar etu avatar j-piecuch avatar jabranham avatar jcs090218 avatar jgarte avatar jian-lin avatar lafrenierejm avatar leungbk avatar ljli avatar matthewbauer avatar nagy avatar nasyxx avatar nightkr avatar nosewings avatar phikal avatar purcell avatar pvmart avatar rossabaker avatar taktoa avatar taku0 avatar tristancacqueray avatar yilinwei avatar yorickvp avatar znewman01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nix-mode's Issues

Add fontlock for antiquotes

I didn't think it would be too hard to add the font lock using nix-syntax-match-antiquote back in, but I'm having issues.

pinging @ljli

Incorrect indentation for let

The proper indentation for the let statement is:

let
  foo = "bar";

But nix-mode will indent like this:

let
foo = "bar";

How to use this?

Is there any chance that you would put this up on MELPA, etc. for use with package.el?

ident-for-tab-command moves the cursor

Pressing tab, with the cursor in the middle of an expression, always moves it to the start of the line.

My expectation would be that it leaves the cursor where it was, relative to the expression (which may be moved). Wrapping the command in (save-excursion) might be good enough to ensure that, but I haven't tried it.

Auto-indentation places cursor in the wrong spot

First of all, this works WAY better than upstream.

I noticed one issue with auto-indenting though.

Let's say on on a line that is indented. Hitting "o" or "O" (I'm using evil) to create a new line below/above also adds the indentation but the cursor is placed BEFORE the spaces.

Below, | is my cursor.

{
  a = "";|
}

Hitting "o" gives me "| " instead of " |" (the quotation marks are only there to highlight the spaces). I can see the spaces are there but trailing the cursor.

{
  a = "";
|
}

If a comment contains `with` the indentation below gets confused.

Example:

{
  # Enable zero-configuration networking with service discorvery.
    services.avahi.enable = true;
    services.avahi.nssmdns = true;
}

Indentation of following lines gets confused. I think it would make sense to ignore comments for the indentation logic.

Indentation is still off

This is using the latest master.

If run auto-indent on this:

{
  network = {
    description = "Some Network";
  };

  machineA = { config, pkgs, ... }: {
    imports = [ ./machines/machine_A.nix {} ];
  };
}

You get:

{
  network = {
  description = "Some Network";
};

  machineA = { config, pkgs, ... }: {
  imports = [ ./machines/machine_A.nix {} ];
};
}

Incorrect indentation of wrapped expressions

  home.file.".emacs.d/init.el".source =
    toString ../../.emacs.d/init.el;
  home.file.".emacs.d/early-init.el".source =
    toString ../../.emacs.d/early-init.el;
  home.file.".emacs.d/straight/versions/default.el".source =
    toString ../../.emacs.d/straight/versions/default.el;

is being indented as:

  home.file.".emacs.d/init.el".source =
    toString ../../.emacs.d/init.el;
    home.file.".emacs.d/early-init.el".source =
      toString ../../.emacs.d/early-init.el;
      home.file.".emacs.d/straight/versions/default.el".source =
        toString ../../.emacs.d/straight/versions/default.el;

indentation should probably be reset if previous line ends with semicolon.

UPD: another case

    x =
      {
      };
      y =
        {
        };

State of flychecking

We pass the flags --eval, --strict and --show-trace.
We do not only evaluate derivations so --eval is probably a given.
--strict makes sense as a default but should be configurable per buffer since it might reject valid code. error: stack overflow (possible infinite recursion) is currently not parsed and flycheck complains ("Exit code > 0, but no error...").
--show-trace is passed to handle errors in imported files. Without --show-trace only the error of the root cause is shown as if we had evaluated that file. If an error in a different file than the one in the current buffer is reported flycheck gives no indication, that something is wrong in the current buffer. With --show-trace we get a stack of errors with While evaluating <thing> at <loc> at the top, where <thing> is e.g. an attribute in the current file and <loc> is its location. So that info is more useful, but since we only use that, no indication to what actually went wrong and where is given. The user has to scan beginning at <loc> for import statements and then open those files and repeat this recursively till the file with the actual cause is reached. So we want to use the top and the bottom error of the call stack to construct a custom error message which includes what went wrong and in which file. Furthermore we could try to report the error at the location of the actual import statement instead of at the attribute that is bound to the expression where the import occurs ({ not-here = <lots-of-code> \*but here ->*\ import ./file-with-err.nix).
In nixpkgs we usually have package expressions as self contained functions in separate files, which are ultimately pulled into all-packages.nix with callPackage. There are two problems with that model with regards to evaluation checking.
rec { a = b; b = a; } is nonsense and nix-instantiate tells us as much. arg: rec { a = b; b = a; } isn't better, but nix-instantiate says <LAMBDA> and has no objections. Since files containing top level sets are pretty rare compared to files with a top level function, this is not so great. Direct references missing in the lexical scope are detected, though. (arg: { a = b; } is an error, but arg: { a = arg.b; } is fine).
Assume a toy model with the files all-packages.nix (rec { callPackage = ...; a = callPackage ./a.nix {}; callPackage ./b.nix {}), a.nix (args: { attrA = 1; }), b.nix ({ a }: someStuff = a.attrB; }. Looking at b.nix alone we can say it is a valid expression and not much more. Knowing that it should at least work in the context of being imported in all-packages.nix we can see it has a problem (a.nix does not provide attrB). The vast majority of code in nixpkgs follows this model.
In practice that means that flycheck when used on nixpkgs does not report very much of interest beyond plain syntax errors, and --strict does not help much, since it has no effect on functions. I think we should do better.
My first idea would be to evaluate some top level expression which may or may not import the .nix file loaded in the current buffer, along with file itself. With --show-trace we should even get accurate reports for the current buffer if our file is affected. Two concerns here.
Making sure that the expression is evaluated far enough that imports for our file are evaluated. If the top level expression is a set, --strict should do that.
nixpkgs is riddled with platform/architecture/.. dependent assertions. We need to ignore them if they fail. nix-instantiate has a --keep-going flag, but so far it didn't do anything for me.

Some commits caused bad indentation and broke the tests

So if I checkout bb602e1 the tests for indentation breaks badly because it indents things badly, which is great and all that we now have tests. We just need to get feedback with travis (which was being worked on) to get a flow of this.

But what's worse is that 4ac7b5a seems to break the indentation that the tests does so nothing happens at all.

My plan for the moment is to add a test which contains broken indentation so we can have a test that that (should-not) match the input file to detect this kind of broken.

I'm not sure what bb602e1 was supposed to do overall since it touched many places. But I find some things that I would consider regressions straight of by reading that commit.

One example, nix-is-comment-p was added which is great and all and get the 3rd element from the result of syntax-ppss:
bb602e1#diff-e75a5e47fe55dc4b6e12cf1e4c7a42adR521

And that function is then used here:
bb602e1#diff-e75a5e47fe55dc4b6e12cf1e4c7a42adL528

Where the original code read the 3th element from the result of syntax-ppss.

Changing 3 to 4 there didn't repair the tests though.

@matthewbauer

add auto-mode-alist entries

It is common practice for emacs major modes, to add themselves to auto-mode-alist.
nix-mode seems to have lost this capability as part of dd49386
I noticed it, because my *.nix files stopped highlighting automatically.

What was the rationale for removing global-nix-mode?

Would you consider re-adding this option, or even just setting up auto-mode-list unconditionally (as is usual for other modes)? cc @matthewbauer

nix-indent-line doesn't indent if-expressions nicely

The following code:

let
x = if a
then if b
then c
else d
else if e
then f
else g;
in
x

is indented by nix-indent-line as:

let
  x = if a
    then if b
    then c
    else d
    else if e
    then f
    else g;
in
  x

but would (IMO) be much clearer as:

let
  x = if a
    then if b
      then c
      else d
    else if e
      then f
      else g;
in
  x

Incorrect indentation

There are some problems with handling empty lists and sets:

{
}

is being indented as

{
  }

and

{
x = [
];
}

as

{
  x = [
    ];
}

As soon as there is at least 1 element, it seems to work fine.

Also this it the reason why it behaves weirdly with electric-pair-mode.

Another case:

{
  a = {
    x1="abc";
  };
b = {
  x2 = 1;
};
}

is just left as is on attempt to indent. But if you add spaces to x1 = "abc";, it'll indent correctly.

Mode detection for nix-shell shebang scripts

If my shebang is #!/bin/bash or #!/usr/bin/env bash, emacs puts me into Shell-script[bash] mode even if my file has no extension. It would be nice if this also worked for

#!/usr/bin/env nix-shell
#!nix-shell -i bash

nix-indent-line as default nix-indent-function

nix-indent-line is marked as buggy, and I'm happy to believe it is, but indent-relative is by contrast completely unusable. I constantly found myself fighting indentation before I found out about nix-indent-line. See @grahamc's screenshare for an example of the kind of thing I mean.

nix-indent-line pulls everything to the left

Opening a nix-mode buffer with the following contents:

{
  x = "hi";
}

And indenting the whole thing (ggVG<tab> with Evil) flattens everything to:

{
x = "hi";
}

This change seems to be caused by 84ee980. More specifically, if I revert the following change:

@@ -415,6 +425,9 @@ STRING-TYPE type of string based off of Emacs syntax table types"
          ((looking-at (nix-mode-quotes-regexp))
           ;; skip over strings entirely
           (re-search-backward (nix-mode-quotes-regexp) nil t))
+         ((looking-at (nix-mode-comments-regexp))
+          ;; skip over comments entirely
+          (re-search-backward (nix-mode-comments-regexp) nil t))
          ((looking-at (nix-mode-ends-regexp))
           ;; count the matched end
           ;; this means we expect to find at least one more cap

Then nix-indent-line starts indenting like a champ again.

State of completions

For the similar reasons as laid out in #14, completions are only provided if the file loaded in the current buffer is a set (which means rarely) and then only for the immediate scope (no drilling into sets passed as arguments). nix-repl gives up on adding functions to scope on principle.
On each call to the company back-end a :r command is issued to the repl. Thus the file as it was last saved is loaded. If it contains e.g. a syntax error, no completions for you, since the file can't be loaded. Also the completions can go out of date fast. We probably want to sync the repl more often and independent of when the file is saved and if our buffer goes invalid, keep on to the last valid code till the buffer is valid again.
On the implementation side, the dance performed to extract the completions from nix-repl is somewhat creative. nix-repl isn't really intended to be an automatically queried back-end. As it stands this feature is of not much use. To implement it better we probably need support in nix-repl or roll out some own tool as a back-end.

Add completion-at-point-function for nix

Some sort of completion will be useful for Nix users. Right now we have asynchronous completion through nix-repl.el but this only works if you have something like Company installed. Some Lisp code could generate completions for Nix expressions.

Who provides nix, nix-geiser, nix-guile, and nix-misc

Libraries in this package require the features nix, nix-geiser, nix-guile, and nix-misc, but no internal libraries provide these features. Are they provided in some other repository? Or am I overlooking something?

* inside '' strings breaks syntax highlighting

Minimal example (not broken here on GH):

{
  foo = "woot/*";
  bar = ''
    woot/*
  '';
  baz = "hello";
}

In latest nix-mode you will see that highlighting is broken from bar onwards due to the * inside the '' being interpreted wrongly.

aggressive indent mode compatability

Hi all, thanks for this emacs package,

this could be a feature request or just a question, as I'm very hooked on aggressive indent mode when I'm writing code, I notice the relative indentation in this package does not flow well with aggressive indent mode. I wonder if I could enable some sort of fixed indentation, that for example, newline after curly braces are fixed to 2 spaces (or any number of spaces customizeable by customizeable variables). Maybe this is a difference of opinion, as I know that emacs users that are used to indent sensitive language like python are probably more satisfied with relative indentation. But this is especially uncomfortable when I'm writing line above block of statements that are aligned togeather, then the line above wont align to the block below by default.

What do you think, would this be a wanted feature?

nix-mode-mmm should only use nix-sh for "phases"

It's hard to predict when something is a "shell script" in Nix. Perhaps we can base it off of the variable name? RE example:

^\s*((?:pre|post)(?:Unpack|Patch|Configure|Build|Check|Install|Fixup|Dist)|(?:unpack|patch|configure|build|check|install|fixup|dist)Phase)\s*=\s*''

Indentation issues

I am running nix-mode 20170831.1721 (the latest stable build on MELPA).

I made a file.nix:

{ ... } :

let

  a = 1;

b = 2;

in

  a + b;

If I go to each line a press tab, this is how it gets indented. The specific problem I have is b = 2; does not have the same indentation as a = 1;. Also, I noticed that pressing tab with point left of in gives this error message:

indent-line-to: Wrong type argument: wholenump, -2

Please let me know if you need any more information! Thanks for this package!

`==` is incorrectly syntax-highlighted

If you create a Nix file containing a (sub)expression of the form foo == bar, where foo is an identifier and bar is an expression, foo will be syntax-highlighted as an attribute (brown), rather than as an identifier (white). This is likely due to some kind of parsing conflict with the { foo = bar; } syntax, in which it is appropriate to highlight foo brown. It would probably be good to add a regression test for this as well, using something similar to the haskell-mode font-lock tests.

nix-indent-line always indents comments two spaces if it's before any nix code

If I take a nix-file that has some comments in the beginning of the file. This happens with the default configuration.nix file like this (but I've replaced the text):

# First line
# Second line
# Third line

{ config, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
  ];

  # Loads of stuff ...
}

If I place the cursor on the first line and run M-x nix-indent-line it will always add two spaces to the indentation of this line. Every time I run it it happens.
If I reset the first line and place on the second line and run M-x nix-indent-line it wall add two spaces of indentation once. Which also seems to be wrong.
The third line behaves the same as the second line

Support find-file-at-point or something like it, to open a file referenced by your nix expression

It would be super neato to support the following use cases:

(1) relative paths, pretty easy since it is relative to the current file!

{
  imports = [
    ./macs/nodes/mac5.nix
  ];
}

having the cursor at the beginning of ./macs/nodes/mac5.nix, being able to do C-c C-o or something to open the file.

(2) paths based on NIX_PATH

a bit trickier, but would be pretty neat:

{ pkgs ? import <nixpkgs> }:
null

being on <nixpkgs> and have it open default.nix of the NIX_PATH's nixpkgs. This can be done with nix-instantiate:

grahamc@Morbo> nix-instantiate  --eval -E '<nixpkgs>'
/nix/var/nix/profiles/per-user/root/channels/nixos

of course, this should also support sub-files using the same method:

grahamc@Morbo> nix-instantiate  --eval -E '<nixpkgs/nixos/lib/make-channel.nix>'
/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/lib/make-channel.nix

Ideally version 2 would also support direnv altering the NIX_PATH.

Indentation bug

If you leave out the hash at the end of line 29 in this file, the lines after it will indent, which is very strange, considering that line 29 is itself commented.

I suspect the indentation tokenizer is failing to ignore commented-out let keywords (though that doesn't really explain why adding the hash at the end of the line fixes it).

Incorrect indentation of multi-line strings

The following code:

{
foo = ''
bar
'';
}

When indented becomes:

{
  foo = ''
  bar
  '';
}

When it should be:

{
  foo = ''
    bar
  '';
}

This seemed to work in 6445ebf but not in bb602e1. I'm gonna dig into it but wanted to have it documented so it can give me a good name for my test files :-)

Indent and syntax highlighting broken for ${..}

Hi, I am on master (fa7a4a0) and I'm hitting two issues that I suspect are related:

1st - the indent after a ${...} in a string doesn't go back to 0:

{
  a = "${hello}";
  } # <-- doesn't move back to indent 0

2nd: syntax highlighting treats the last line as a string:

{
  a = "${hello}";
} // { b = 10; }

Cannot load nix-mode installed via nixpkgs.melpa

Hello, I'm having some troubles getting nix-mode to load in Emacs. I have tried installing it from both Melpa and Melpa Stable and I can see the package on my load-path, yet when I try to invoke nix-mode, nothing happens and trying to evaluate the use-package expression for it yields

#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (:use-package (23541 64017 73147 0) :preface (23541 63986 609681 0) :init (23541 64017 73142 0) :init-secs (0 0 46 0) :preface-secs (0 0 87 0) :use-package-secs (0 0 56 0) ...))

If I then add the :mode keyword to my use-package like so:

(use-package nix-mode
  :mode "\\.nix\\'")

I instead get this error.

File mode specification error: (file-missing Cannot open load file No such file or directory nix-mode)

You can see my emacs.nix here and my configuration lives here.

EDIT: For posterity, this is what my load-path looks like:

("/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/yasnippet-snippets-20180909.315" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/aggressive-indent-1.8.3" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/amx-20180627.1555" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/apropospriate-theme-20180906.1106" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/async-1.9.2" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/async-20180527.1030" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-latexmk-20170618.936" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auto-compile-20180321.807" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/biblio-20161014.1604" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/biblio-core-20160901.1115" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/bind-key-20180512.2130" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20180913.1611" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-auctex-20180725.1212" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-math-20171016.814" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-nginx-20180603.1702" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-quickhelp-20180525.303" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-reftex-20180713.141" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-shell-20170517.2241" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/company-statistics-20170210.1133" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/counsel-20180913.221" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/counsel-projectile-20180906.39" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-20180910.1156" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-functional-20180107.818" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/deadgrep-20180912.1603" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/delight-1.5" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20180201.355" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/dockerfile-mode-20180914.416" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ebib-20180817.324" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/elisp-refs-20180715.1602" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/epl-20180205.1249" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-20180914.516" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-collection-20180915.632" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-commentary-20170413.751" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-goggles-20180725.252" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-lion-20170810.2314" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-magit-20180702.853" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-smartparens-20171210.713" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-surround-20180102.601" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/exec-path-from-shell-20180323.1904" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/f-20180106.122" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/flycheck-20180907.619" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/flycheck-haskell-20180611.1442" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/flyspell-correct-20180915.654" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/flyspell-correct-ivy-20180427.1135" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/general-20180901.852" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ghub-20180914.102" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/git-commit-20180912.312" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/goto-chg-20180105.1033" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/graphql-20180911.1731" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20180912.2048" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-20180905.2217" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-bibtex-20180826.848" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-core-20180825.2215" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/helpful-20180912.1643" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/hl-todo-20180709.2155" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/hlint-refactor-20170817.2148" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/htmlize-20180412.1244" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/hydra-0.14.0" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/hydra-20180703.802" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/intero-20180806.1445" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ivy-20180911.1001" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ivy-bibtex-20180826.848" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ivy-yasnippet-20180831.915" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/json-mode-20180718.109" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/json-reformat-20160212.53" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/json-snatcher-20150511.2047" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/key-chord-20160227.438" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/latex-extra-20170816.1847" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.5" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/loop-20160813.707" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/macrostep-20161120.1306" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/magic-latex-buffer-20170530.1705" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20180915.659" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-popup-20180726.1337" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20180904.901" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/math-symbol-lists-20170221.553" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/nasm-mode-20180711.1209" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/nginx-mode-20170611.2137" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-20180910" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-plus-contrib-20180910" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20180913.1607" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/packed-20180318.1029" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/parsebib-20180116.627" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-0.80" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/pkg-info-20150517.443" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/popup-20160709.729" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/pos-tip-20150318.813" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/projectile-20180910.2240" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/rainbow-delimiters-20170929.432" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/rust-mode-20180626.1512" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/s-20180406.108" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.20" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/shut-up-20180628.1130" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/smartparens-20180912.1050" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/spinner-1.7.3" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/swiper-20180813.925" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/tablist-20170219.1935" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/treepy-20180723.2356" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/undo-tree-0.6.5" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/use-package-20180715.1101" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/which-key-20180621.1238" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/with-editor-20180726.1344" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/ws-butler-20170111.1534" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/yaml-mode-20180408.2307" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/yasnippet-20180620.1750" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/build-aux" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/doc" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/etc" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/images" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/latex" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/tests" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/hydra-0.14.0/targets" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-20180910/etc" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-plus-contrib-20180910/etc" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20180913.1607/citeproc" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.20/tests" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/tests/context" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/tests/japanese" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/tests/latex" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/auctex-12.1.1/tests/tex" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-20180910/etc/styles" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-plus-contrib-20180910/etc/styles" "/nix/store/5pm51m6i3x1bw0v378qcsfxc1nn6im5y-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20180913.1607/citeproc/csl" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/site-lisp" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/site-lisp" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/vc" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/url" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/textmodes" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/progmodes" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/play" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/org" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/nxml" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/net" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/mh-e" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/mail" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/leim" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/language" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/international" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/image" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/gnus" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/eshell" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/erc" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/emulation" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/emacs-lisp" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/cedet" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/calendar" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/calc" "/nix/store/932r74r2m5yav4177bkl3nq69gj8jvfk-emacs-26.1/share/emacs/26.1/lisp/obsolete" "/Users/sondre/.emacs.d/core/" "/Users/sondre/.emacs.d/base/" "/Users/sondre/.emacs.d/modules/langs/" "/Users/sondre/.emacs.d/modules/tools/" "/Users/sondre/.emacs.d/modules/text/" "/Users/sondre/.emacs.d/modules/org/" "/Users/sondre/.emacs.d/utils/")

EDIT2: Weird, it seems that nix-mode has disappeared even from my load-path. Crap. It is on my /nix/store though: /nix/store/klwxw8669ks93ffvsvn6w09zhar4nbcf-emacs-nix-mode-20180908.1540.

EDIT3: Oh, there's a emacs-26.1 binary in my $PATH where the load-path is correct. I think I'll sleep on this ๐Ÿ˜ด

`${` not correctly highlighted in double-quoted strings

A string of the form

"foo-${bar}"

gets blue highlighting for the initial ${ but otherwise is not correctly highlighted.

Note that that is a double-quoted string ("foo") rather than a double-single-quoted string (''foo''), which has the correct behavior in nix-mode master.

Example screenshot:

Indentation broken in melpa package?

Hi,

Installing the lastest melpa nix-mode package (20181015.100), indentiation appears to be completely broken?

This seems unlikely, so I assumed it must be something wrong with my configuration or one of my other packages. I've tried the following, but none of them made a difference:

  • Emacs 25.3 and Emacs 26.1
  • Removing all other packages except json-mode
  • Wiping most of my config
  • Setting nix-indent-function to nix-indent-line

If I visit a .nix file, I can see that nix-mode is enabled, but hitting C-h (highlight buffer) followed by <TAB> (indent) just moves everything to the left margin with no indentation.

The stripped-down config file I am testing with looks like this:

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-archives
   (quote
    (("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa" . "http://melpa.milkbox.net/packages/"))))
 '(package-selected-packages (quote (nix-mode json-mode))))

(provide `.emacs)
;;; .emacs ends here
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

Any suggestions?

I am thinking that my next attempt will be to manually install the latest master version from Github.

Regards,
Glenn

''$${ not highlighted correctly

I was not aware this was acceptable in Nix, but noticed this fetchFromGitHub implementation:

{ lib, fetchgit, fetchzip }:

{ owner, repo, rev, name ? "source"
, fetchSubmodules ? false, private ? false
, githubBase ? "github.com", varPrefix ? null
, ... # For hash agility
}@args: assert private -> !fetchSubmodules;
  let
    baseUrl = "https://${githubBase}/${owner}/${repo}";
    passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
    varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
    # We prefer fetchzip in cases we don't need submodules as the hash
    # is more stable in that case.
    fetcher = if fetchSubmodules then fetchgit else fetchzip;
    privateAttrs = lib.optionalAttrs private {
      netrcPhase = ''
      if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then
        echo "Error: Private fetchFromGitHub requires the nix building process (nix-daemon in multi user mode) to have the ${varBase}USERNAME and ${varBase}PASSWORD env vars set." >&2
        exit 1
      fi
      cat > netrc <<EOF
      machine ${githubBase}
              login ''$${varBase}USERNAME
        password ''$${varBase}PASSWORD
      EOF
    '';
      netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
    };
    fetcherArgs = (if fetchSubmodules
                   then { inherit rev fetchSubmodules; url = "${baseUrl}.git"; }
                   else ({ url = "${baseUrl}/archive/${rev}.tar.gz"; } // privateAttrs)
    ) // passthruAttrs // { inherit name; };
  in fetcher fetcherArgs // { meta.homepage = baseUrl; inherit rev; }

''$${varBase}USERNAME is not recognized as an antiquote correctly. This also may be messing with indentation as well.

Add auto-fill for nix expressions

python-mode has a nice auto-fill function. It would be useful to have on in Nix as well. Defining it is easy with:

(setq-local fill-paragraph-function nix-fill-paragraph)

The hard part is figuring out the right rules for nix-fill-paragraph.

Font lock gives up after some point

This is a weird error, but sometimes font-lock seems to just give up and quit with the new fontification changes. Toggling (font-lock-mode) seems to fix it but it will show up again somewhere else after some edits are made.

screen shot 2017-03-31 at 12 37 06 am

Syntax highlighting for ${..} attributes not working

First, thanks for doing this! This mode is so much better than the various hacks I had accumulated on top of the official mode.

I have a minor, low priority issue that's easily fixed by adding "" quotation marks:

    users.extraGroups.${promGroup}.gid = config.ids.gids.prometheus;
      users.extraUsers.${promUser} = {}

doesn't pick up the closing }, and continues highlighting the rest of the text with the same colour as promGroup.

Usage of nix-eshell?

I am sorry. I am very new to elisp and lisp and can't make sense of this via source code.

I am using nix-eshell with my project's default.nix, expecting to be dropped into the same evnironment as I would if I just call nix-shell in a regular terminal.

However, it drops me into eshell session with none of packages listed in my default.nix available.

Is this a bug or am I using it in the wrong way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.