about summary refs log tree commit diff
path: root/system/modules/emacs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'system/modules/emacs.nix')
-rw-r--r--system/modules/emacs.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/system/modules/emacs.nix b/system/modules/emacs.nix
new file mode 100644
index 0000000000..1cfa2b0745
--- /dev/null
+++ b/system/modules/emacs.nix
@@ -0,0 +1,23 @@
+{ config, pkgs, lib, ... }:
+with lib;
+{
+  options.programs.emacs.useGit = mkOption {
+    description = "Use emacs from git";
+    type = types.bool;
+    default = false;
+  };
+
+  config = {
+    nixpkgs.overlays = if config.programs.emacs.useGit then [] else [
+      (import (builtins.fetchTarball https://github.com/nix-community/emacs-overlay/archive/master.tar.gz))
+    ];
+
+    environment.systemPackages = with pkgs; [
+      (if config.programs.emacs.useGit then emacsGit else emacs)
+      ripgrep
+      coreutils
+      fd
+      clang
+    ];
+  };
+}