From b663bb03c88059ecdc8ef601eb2539b8fcc14d9f Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Sat, 16 Apr 2022 16:48:12 -0400 Subject: [PATCH] Add clojure environment --- README.org | 42 ++++++++++++++++++++++++++++++++++++++++++ modules/emacs.nix | 2 ++ shells/clojure.nix | 11 +++++++++++ 3 files changed, 55 insertions(+) create mode 100644 shells/clojure.nix diff --git a/README.org b/README.org index a2eedfc..730ac60 100644 --- a/README.org +++ b/README.org @@ -420,6 +420,26 @@ mkShell { } #+END_SRC +** Clojure + +[[https://clojure.org][Clojure]] is a dynamic and functional dialect of the Lisp programming language on the Java platform. Like other dialects, Clojure treats code as data and has a Lisp macro system. The current development process is community driven. + +Import this shell with ~nix-shell /etc/dotfiles/shells/clojure.nix~. + +#+BEGIN_SRC nix :noweb yes :tangle shells/clojure.nix +# <> +{ pkgs ? import { } }: + +with pkgs; +mkShell { + buildInputs = [ + leiningen + ]; + shellHook = '' + ''; +} +#+END_SRC + * Host Configurations [[https://nixos.org/][NixOS]] typically stores the current machine configuration in =/etc/nixos/configuration.nix=. In this project, this file is stored in =/etc/dotfiles/hosts/$HOSTNAME/...=, and imported, along with the generated hardware configurations. This ensures that multiple host machines can share the same modules, and generating new host definitions is trivial. It also makes it easier to share common configurations amongst all of the hosts, such as with pre-configured wireless networking: @@ -1083,6 +1103,7 @@ let <> <> <> + <> <> <> @@ -1160,6 +1181,7 @@ When Emacs is started, it normally tries to load a Lisp program from an ititiali <> <> <> +<> <> <> @@ -2410,6 +2432,26 @@ The built in [[https://emacswiki.org/emacs/PythonProgrammingInEmacs][Python Mode epkgs.protobuf-mode #+END_SRC +** Clojure Environment + +#+NAME: emacs-clojure-package +#+BEGIN_SRC nix +epkgs.clojure-mode +epkgs.cider +#+END_SRC + +[[https://github.com/clojure-emacs/clojure-mode][Clojure Mode]] is an Emacs major mode that provides font-lock (syntax highlighting), indentation, navigation, and refactoring support for the [[https://clojure.org][Clojure]] programming language. + +https://github.com/clojure-emacs/cider extends Emacs with support for interactive programming in Clojure. The features are centered around =cider-mode=, adding a running process for compilation, code completion, debugging, definition and documentation lookup, running tests, and more. + +#+NAME: emacs-clojure-elisp +#+BEGIN_SRC emacs-lisp +;; Configure `clojure-mode' and `cider'. +(add-hook 'clojure-mode-hook 'lsp) +(add-hook 'clojurescript-mode-hook 'lsp) +(add-hook 'clojurec-mode-hook 'lso) +#+END_SRC + ** PlantUML #+NAME: emacs-plantuml-extras diff --git a/modules/emacs.nix b/modules/emacs.nix index ca1df41..0c98476 100644 --- a/modules/emacs.nix +++ b/modules/emacs.nix @@ -52,6 +52,8 @@ let epkgs.go-mode epkgs.pretty-mode epkgs.rustic + epkgs.clojure-mode + epkgs.cider epkgs.plantuml-mode epkgs.protobuf-mode diff --git a/shells/clojure.nix b/shells/clojure.nix new file mode 100644 index 0000000..746d9d8 --- /dev/null +++ b/shells/clojure.nix @@ -0,0 +1,11 @@ +# This file is controlled by /etc/dotfiles/README.org +{ pkgs ? import { } }: + +with pkgs; +mkShell { + buildInputs = [ + leiningen + ]; + shellHook = '' + ''; +}