2018-03-20 16:38:26 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2019-09-28 19:00:03 +00:00
|
|
|
pkgsWithOverlay = import <nixpkgs-unstable> {
|
|
|
|
overlays = [
|
|
|
|
(import (builtins.fetchTarball {
|
2020-03-28 17:54:51 +00:00
|
|
|
url = https://github.com/nix-community/emacs-overlay/archive/403c14c23be188b58c0b1bc197b428041d8a0cea.tar.gz;
|
2019-09-28 19:00:03 +00:00
|
|
|
}))
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2020-04-14 18:43:33 +00:00
|
|
|
# The emacs packages that I use
|
|
|
|
# I differ between
|
|
|
|
# - stable (Packages that I use for some time - happy with it)
|
|
|
|
# - unstable (Packages that I use for some time - but may drop)
|
|
|
|
# - testing (Packages that I try out - the new stuff)
|
|
|
|
emacsPkgs = epkgs:
|
|
|
|
(with epkgs.melpaPackages ;
|
2019-11-14 14:34:49 +00:00
|
|
|
|
2020-04-14 18:43:33 +00:00
|
|
|
## helm (stable)
|
|
|
|
# emacs completion engine
|
|
|
|
[ helm helm-ag ] ++
|
|
|
|
|
|
|
|
## deft (testing)
|
|
|
|
# text search for a directory
|
|
|
|
[ deft ] ++
|
|
|
|
|
|
|
|
## lsp mode (unstable)
|
|
|
|
# Language Server Protocol mode
|
|
|
|
# Used for rust
|
|
|
|
[ company-lsp dap-mode helm-lsp lsp-mode lsp-treemacs lsp-ui ] ++
|
|
|
|
|
|
|
|
## emacs convenience (stable)
|
|
|
|
# Mixed and general purpose
|
|
|
|
[ ag company direnv evil google-this spacemacs-theme ] ++
|
|
|
|
|
|
|
|
## common lisp (testing)
|
|
|
|
[ slime ] ++
|
|
|
|
|
|
|
|
## magit (stable)
|
|
|
|
[ magit ] ++
|
|
|
|
|
|
|
|
## bunch of programming languages (unstable)
|
|
|
|
[ go-mode haskell-mode nix-mode ] ++
|
|
|
|
|
|
|
|
## rust (unstable)
|
|
|
|
[ racer rust-mode ] ++
|
|
|
|
|
|
|
|
## python (stable)
|
|
|
|
# Python IDE for emacs
|
|
|
|
[ elpy ]) ++
|
|
|
|
|
|
|
|
## org-mode
|
|
|
|
# Org-Mode has several extensions
|
|
|
|
# and can be seen as an application of its own.
|
|
|
|
(with epkgs.melpaPackages ;
|
2019-11-14 14:34:49 +00:00
|
|
|
# testing
|
2020-04-14 18:43:33 +00:00
|
|
|
[ org-super-agenda org-bullets org-ql ] ++
|
|
|
|
# unstable
|
|
|
|
[ smex org-mime orgit ]
|
|
|
|
) ++
|
|
|
|
|
|
|
|
# stable
|
|
|
|
(with epkgs.orgPackages ;
|
|
|
|
[ org-plus-contrib ]) ++
|
|
|
|
|
|
|
|
(with epkgs.elpaPackages ;
|
|
|
|
[ bbdb which-key ]);
|
|
|
|
|
|
|
|
# ## EXWM related (unstable)
|
|
|
|
# epkgs.exwm
|
|
|
|
# epkgs.melpaPackages.desktop-environment
|
|
|
|
# epkgs.melpaPackages.helm-exwm
|
|
|
|
# ];
|
2019-11-14 14:34:49 +00:00
|
|
|
|
|
|
|
emacsWithOverlay = pkgsWithOverlay.emacsWithPackagesFromUsePackage {
|
2020-02-11 16:52:46 +00:00
|
|
|
config = builtins.readFile ./elisp/init.el;
|
2019-11-14 14:34:49 +00:00
|
|
|
# Package is optional, defaults to pkgs.emacs
|
|
|
|
package = pkgsWithOverlay.emacsGit;
|
|
|
|
# Optionally provide extra packages not in the configuration file
|
|
|
|
extraEmacsPackages = emacsPkgs;
|
|
|
|
};
|
2018-11-02 08:43:47 +00:00
|
|
|
|
2018-03-20 19:16:12 +00:00
|
|
|
myEmacs = pkgs.writeDashBin "my-emacs" ''
|
2020-04-14 18:42:06 +00:00
|
|
|
exec ${emacsWithOverlay}/bin/emacs -q "$@"
|
2018-03-20 19:16:12 +00:00
|
|
|
'';
|
2018-11-02 08:43:47 +00:00
|
|
|
|
|
|
|
myEmacsWithDaemon = pkgs.writeDashBin "my-emacs-daemon" ''
|
2020-04-14 18:42:06 +00:00
|
|
|
exec ${emacsWithOverlay}/bin/emacs -q --daemon
|
2018-11-02 08:43:47 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
myEmacsClient = pkgs.writeDashBin "meclient" ''
|
2020-04-14 18:42:37 +00:00
|
|
|
exec ${emacsWithOverlay}/bin/emacsclient --create-frame "$@"
|
2018-11-02 08:43:47 +00:00
|
|
|
'';
|
2018-03-20 16:38:26 +00:00
|
|
|
in {
|
|
|
|
environment.systemPackages = [
|
2020-02-11 16:52:46 +00:00
|
|
|
myEmacs myEmacsWithDaemon myEmacsClient emacsWithOverlay
|
2018-03-20 16:38:26 +00:00
|
|
|
];
|
2020-02-11 16:52:46 +00:00
|
|
|
|
2020-03-30 06:18:46 +00:00
|
|
|
## EXWM Config
|
|
|
|
# services.xserver = {
|
|
|
|
# enable = true;
|
|
|
|
# xkbOptions = "caps:super";
|
|
|
|
# exportConfiguration = true;
|
|
|
|
#
|
|
|
|
# displayManager.slim.enable = true;
|
|
|
|
# windowManager.default = "exwm";
|
|
|
|
#
|
|
|
|
# # Set up the login session
|
|
|
|
# windowManager.session = [{
|
|
|
|
# name = "exwm";
|
|
|
|
# start = "${emacsWithOverlay}/bin/emacs -q -l " + builtins.toString ./elisp/init.el;
|
|
|
|
# }];
|
|
|
|
# };
|
2018-03-20 16:38:26 +00:00
|
|
|
}
|