I'm trying to define the Nix language, this is what I have so far.
Code: Select all
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{stringColor}{HTML}{718a62}
\lstdefinelanguage{Nix}{
keywords=[1]{true, false, null},
keywords=[2]{let, in, with, rec, inherit},
keywords=[3]{toString},
keywordstyle=\color{blue},
sensitive=true,
% comments
comment=[l]{\#},
morecomment=[s]{/*}{*/},
commentstyle=\color{gray},
% strings
morestring=[s]"",
morestring=[s]{''}{''},
stringstyle=\color{stringColor},
}
\begin{document}
\begin{lstlisting}[language=Nix]
{
services.example = {
enable = true;
configFile = "${pkgs.suricata}/etc/suricata/suricata.yaml";
# ^^^^^^^^^^^^^^^^ <-- this should be red
};
}
\end{lstlisting}
\end{document}
Any idea how I could implement this?
Thanks in advance!