commit 928d0e437cd7430734a9db91d0d1e9b4aea69292
parent 68f6e967ed279bfd7d323f1ee6f8d7ec27fdc7bd
Author: benjamin paul <bpaul@bpaul.xyz>
Date: Sat, 3 Jul 2021 12:05:34 +1000
Initial emacs setup with evil-mode
Diffstat:
3 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/flake.lock b/flake.lock
@@ -32,6 +32,21 @@
"type": "github"
}
},
+ "emacs-overlay": {
+ "locked": {
+ "lastModified": 1625217780,
+ "narHash": "sha256-uRRf7mlDbMtefWd78Q6u6XqDU/Y8J7KiNmc3P2AhVaI=",
+ "owner": "nix-community",
+ "repo": "emacs-overlay",
+ "rev": "5e93dbe9a28b5c0b80f0aa360b8714bd7bb693b4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "emacs-overlay",
+ "type": "github"
+ }
+ },
"flake-utils": {
"locked": {
"lastModified": 1623875721,
@@ -612,6 +627,7 @@
},
"root": {
"inputs": {
+ "emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"idris2-pkgs": "idris2-pkgs",
diff --git a/flake.nix b/flake.nix
@@ -25,6 +25,11 @@
url = "github:claymager/idris2-pkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
+
+ emacs-overlay = {
+ url = "github:nix-community/emacs-overlay";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
outputs =
@@ -34,6 +39,7 @@
, neovim
, vim-plugins-overlay
, idris2-pkgs
+ , emacs-overlay
, ...
}@inputs:
let
@@ -41,6 +47,7 @@
neovim.overlay
vim-plugins-overlay.overlay
#idris2-pkgs.overlay
+ emacs-overlay.overlay
];
lib = nixpkgs.lib;
libExtra = import ./lib { inherit lib; };
diff --git a/home/modules/dev/emacs/default.nix b/home/modules/dev/emacs/default.nix
@@ -0,0 +1,42 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+ options.emacs = {
+ enable = mkEnableOption "Emacs";
+ };
+
+ config = mkIf config.emacs.enable {
+ programs.emacs = {
+ enable = true;
+ package = pkgs.emacsPgtkGcc;
+
+ extraPackages = epkgs: [
+ epkgs.gruvbox-theme
+ ];
+ };
+
+ home.file.".emacs.d/init.el".text = ''
+;; Set up package.el to work with MELPA
+(require 'package)
+(add-to-list 'package-archives
+ '("melpa" . "https://melpa.org/packages/"))
+(package-initialize)
+(package-refresh-contents)
+
+;; Download Evil
+(unless (package-installed-p 'evil)
+ (package-install 'evil))
+
+(setq evil-want-C-u-scroll t)
+
+;; Enable Evil
+(require 'evil)
+(evil-mode 1)
+
+(load-theme 'gruvbox t)
+ '';
+ services.emacs.enable = true;
+ };
+}