Merge branch 'develop' into master

This commit is contained in:
László Vaskó
2020-09-15 13:02:21 +02:00
7 changed files with 132 additions and 25 deletions

View File

@ -38,3 +38,11 @@ in {
This expression leverages This expression leverages
[nix-straight.el](https://github.com/vlaci/nix-straight.el) under the hood for [nix-straight.el](https://github.com/vlaci/nix-straight.el) under the hood for
installing depdendencies. The restrictions of that package apply here too. installing depdendencies. The restrictions of that package apply here too.
## Usage
instead of running emacs.d/bin/doom, once you have update your config files (packages.el, init.el, config.el), rebuild doom-emacs with nix. If you are using home-manager, simply run `home-manager switch`
## Troubleshooting
On macOS on a fresh install, you might run into the error `Too many files open`. running `ulimit -S -n 2048` will only work for the duration of your shell and will fix the error

View File

@ -1,13 +1,28 @@
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
;;; Skip Emacs's own package verification and let Nix do it for us.
;;;
;;; Having gnupg around the build triggers Emacs to use it for package signature
;;; verification. This would not work anyway because the build sandbox does not
;;; have a properly configured user home and environment.
(setq package-check-signature nil)
(defun nix-straight-inhibit-kill-emacs (arg)
(message "[nix-doom-emacs] Inhibiting (kill-emacs)"))
(advice-add 'nix-straight-get-used-packages (advice-add 'nix-straight-get-used-packages
:before (lambda (&rest r) :around (lambda (orig-fn &rest r)
(message "[nix-doom-emacs] Advising doom installer to gather packages to install...") (message "[nix-doom-emacs] Advising doom installer to gather packages to install...")
(advice-add 'doom-autoloads-reload (advice-add 'doom-autoloads-reload
:override (lambda (&optional file force-p) :override (lambda (&optional file force-p)
(message "[nix-doom-emacs] Skipping generating autoloads..."))) (message "[nix-doom-emacs] Skipping generating autoloads...")))
(advice-add 'doom--print (advice-add 'doom--print
:override (lambda (output) :override (lambda (output)
(message output))))) (message output)))
(advice-add 'kill-emacs
:override #'nix-straight-inhibit-kill-emacs)
(apply orig-fn r)
(advice-remove 'kill-emacs 'nix-straight-inhibit-kill-emacs)))
(advice-add 'y-or-n-p (advice-add 'y-or-n-p
:override (lambda (q) :override (lambda (q)

View File

@ -49,6 +49,7 @@
, runCommand , runCommand
, fetchFromGitHub , fetchFromGitHub
, substituteAll , substituteAll
, writeShellScript
, writeShellScriptBin , writeShellScriptBin
, writeTextDir }: , writeTextDir }:
@ -171,11 +172,25 @@ let
in (emacsPackages.emacsWithPackages (epkgs: [ in (emacsPackages.emacsWithPackages (epkgs: [
load-config-from-site load-config-from-site
])); ]));
build-summary = writeShellScript "build-summary" ''
BOLD=\\033[1m
GREEN=\\033[32m
RESET=\\033[0m
printf "\n''${GREEN}Successfully built nix-doom-emacs!''${RESET}\n"
printf "''${BOLD} ==> doom-emacs is installed to ${doom-emacs}''${RESET}\n"
printf "''${BOLD} ==> private configuration is installed to ${doomDir}''${RESET}\n"
printf "''${BOLD} ==> Dependencies are installed to ${doomLocal}''${RESET}\n"
'';
in in
emacs.overrideAttrs (esuper: emacs.overrideAttrs (esuper:
let cmd = '' let cmd = ''
for prog in $out/bin/*; do for prog in $out/bin/*; do
wrapProgram $out/bin/$(basename $prog) --set DOOMDIR ${doomDir} wrapProgram $out/bin/$(basename $prog) \
--set DOOMDIR ${doomDir} \
--set __DEBUG_doom_emacs_DIR ${doom-emacs} \
--set __DEBUG_doomLocal_DIR ${doomLocal}
done done
# emacsWithPackages assumes share/emacs/site-lisp/subdirs.el # emacsWithPackages assumes share/emacs/site-lisp/subdirs.el
# exists, but doesn't pass it along. When home-manager calls # exists, but doesn't pass it along. When home-manager calls
@ -184,6 +199,7 @@ emacs.overrideAttrs (esuper:
# https://github.com/NixOS/nixpkgs/issues/66706 # https://github.com/NixOS/nixpkgs/issues/66706
rm -rf $out/share rm -rf $out/share
ln -s ${esuper.emacs}/share $out ln -s ${esuper.emacs}/share $out
${build-summary}
''; '';
in in
if esuper ? buildCommand then if esuper ? buildCommand then

View File

@ -1,8 +1,8 @@
diff --git a/core/autoload/config.el b/core/autoload/config.el diff --git a/core/autoload/config.el b/core/autoload/config.el
index 6bb9ae300..81ab62860 100644 index 1e643cf49..501cbfba4 100644
--- a/core/autoload/config.el --- a/core/autoload/config.el
+++ b/core/autoload/config.el +++ b/core/autoload/config.el
@@ -20,7 +20,7 @@ @@ -23,7 +23,7 @@
(defun doom/find-file-in-private-config () (defun doom/find-file-in-private-config ()
"Search for a file in `doom-private-dir' inside nixos-config." "Search for a file in `doom-private-dir' inside nixos-config."
(interactive) (interactive)
@ -10,4 +10,19 @@ index 6bb9ae300..81ab62860 100644
+ (doom-project-find-file "@private@")) + (doom-project-find-file "@private@"))
;;;###autoload ;;;###autoload
(defun doom/reload () (defun doom/goto-private-init-file ()
diff --git a/modules/app/rss/config.el b/modules/app/rss/config.el
index c5657eec8..34f303420 100644
--- a/modules/app/rss/config.el
+++ b/modules/app/rss/config.el
@@ -18,8 +18,8 @@ easier to scroll through.")
(use-package! elfeed
:commands elfeed
:init
- (setq elfeed-db-directory (concat doom-local-dir "elfeed/db/")
- elfeed-enclosure-default-dir (concat doom-local-dir "elfeed/enclosures/"))
+ (setq elfeed-db-directory (concat doom-cache-dir "elfeed/db/")
+ elfeed-enclosure-default-dir (concat doom-cache-dir "elfeed/enclosures/"))
:config
(setq elfeed-search-filter "@2-week-ago "
elfeed-show-entry-switch #'pop-to-buffer

View File

@ -1,15 +1,12 @@
diff --git a/core/core.el b/core/core.el diff --git a/core/core.el b/core/core.el
index cb12f8d08..03f370691 100644 index c8cfb0495..d8ed107bd 100644
--- a/core/core.el --- a/core/core.el
+++ b/core/core.el +++ b/core/core.el
@@ -63,22 +63,21 @@ decrease this. If you experience stuttering, increase this.") @@ -92,20 +92,20 @@ envvar will enable this at startup.")
"The root directory for Doom's modules. Must end with a slash.")
(defconst doom-local-dir (defconst doom-local-dir
- (if-let (localdir (getenv "DOOMLOCALDIR")) (if-let (localdir (getenv "DOOMLOCALDIR"))
- (expand-file-name (file-name-as-directory localdir)) (expand-file-name (file-name-as-directory localdir))
- (concat doom-emacs-dir ".local/")) - (concat doom-emacs-dir ".local/"))
+ (or (getenv "DOOMLOCALDIR")
+ "@local@/") + "@local@/")
"Root directory for local storage. "Root directory for local storage.

View File

@ -5,10 +5,10 @@
"homepage": "", "homepage": "",
"owner": "hlissner", "owner": "hlissner",
"repo": "doom-emacs", "repo": "doom-emacs",
"rev": "092480152e2ad9c70b60c4aa89d87af02da9f997", "rev": "ae3a2fa8c27d8e392294904ec6986f860a57f38e",
"sha256": "0hpapk8ajmcx08npkp0gdzn0vfmlmp5wsy9sinnyhhbj2b0z48bw", "sha256": "1f3vz9f10qqcxb9lwa51jkvg01v276gb1ssg2gc9jmny2m84d987",
"type": "tarball", "type": "tarball",
"url": "https://github.com/hlissner/doom-emacs/archive/092480152e2ad9c70b60c4aa89d87af02da9f997.tar.gz", "url": "https://github.com/hlissner/doom-emacs/archive/ae3a2fa8c27d8e392294904ec6986f860a57f38e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"doom-snippets": { "doom-snippets": {
@ -17,10 +17,10 @@
"homepage": "", "homepage": "",
"owner": "hlissner", "owner": "hlissner",
"repo": "doom-snippets", "repo": "doom-snippets",
"rev": "60c57d66d2afd1798bff5023a54ab155f311746a", "rev": "94292e263b3351ddcd86dcb84acb19b8adaeab06",
"sha256": "1q8rzmkrgqdwmkdkcz9njbg3rmasrp19vwcqbqbbp6956i7mwyyq", "sha256": "0gx84ggg2226dwhqcsb8sk687ykbgp6sjxkryyh9jql01sjlb147",
"type": "tarball", "type": "tarball",
"url": "https://github.com/hlissner/doom-snippets/archive/60c57d66d2afd1798bff5023a54ab155f311746a.tar.gz", "url": "https://github.com/hlissner/doom-snippets/archive/94292e263b3351ddcd86dcb84acb19b8adaeab06.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"emacs-overlay": { "emacs-overlay": {
@ -29,10 +29,10 @@
"homepage": "", "homepage": "",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "5d36f14d62da38e5f71c4dcc151ecbaa9feffbbc", "rev": "943ec43e54f5152c4d5d8d0076e72beea9a7ff5a",
"sha256": "1nj5flxc9xwl9v9ay2d60z4gash37ppb1g66fwf9gmf54dyb3xhn", "sha256": "1amckm9gnh8jr3f34m67im3fwjf5mm262m4sbar24j1f066dsgil",
"type": "tarball", "type": "tarball",
"url": "https://github.com/nix-community/emacs-overlay/archive/5d36f14d62da38e5f71c4dcc151ecbaa9feffbbc.tar.gz", "url": "https://github.com/nix-community/emacs-overlay/archive/943ec43e54f5152c4d5d8d0076e72beea9a7ff5a.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"emacs-so-long": { "emacs-so-long": {
@ -83,6 +83,18 @@
"url": "https://github.com/rgrinberg/evil-quick-diff/archive/69c883720b30a892c63bc89f49d4f0e8b8028908.tar.gz", "url": "https://github.com/rgrinberg/evil-quick-diff/archive/69c883720b30a892c63bc89f49d4f0e8b8028908.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"explain-pause-mode": {
"branch": "master",
"description": "top, but for Emacs.",
"homepage": "",
"owner": "lastquestion",
"repo": "explain-pause-mode",
"rev": "2356c8c3639cbeeb9751744dbe737267849b4b51",
"sha256": "0frnfwqal9mrnrz6q4v7vcai26ahaw81894arff1yjw372pfgv7v",
"type": "tarball",
"url": "https://github.com/lastquestion/explain-pause-mode/archive/2356c8c3639cbeeb9751744dbe737267849b4b51.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nix-straight.el": { "nix-straight.el": {
"branch": "v2.1.0", "branch": "v2.1.0",
"description": null, "description": null,
@ -95,6 +107,18 @@
"url": "https://github.com/vlaci/nix-straight.el/archive/9e6f7d71760b997b09d9bd3046257bc9ec17265b.tar.gz", "url": "https://github.com/vlaci/nix-straight.el/archive/9e6f7d71760b997b09d9bd3046257bc9ec17265b.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"nose": {
"branch": "master",
"description": null,
"homepage": null,
"owner": "emacsattic",
"repo": "nose",
"rev": "f8528297519eba911696c4e68fa88892de9a7b72",
"sha256": "07bhzddaxdjd591xmg59yd657a1is0q515291jd83mjsmgq258bm",
"type": "tarball",
"url": "https://github.com/emacsattic/nose/archive/f8528297519eba911696c4e68fa88892de9a7b72.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"ob-racket": { "ob-racket": {
"branch": "master", "branch": "master",
"description": "Org babel support for racket", "description": "Org babel support for racket",
@ -113,10 +137,10 @@
"homepage": "https://code.orgmode.org/bzg/org-mode", "homepage": "https://code.orgmode.org/bzg/org-mode",
"owner": "emacs-straight", "owner": "emacs-straight",
"repo": "org-mode", "repo": "org-mode",
"rev": "a1e5bee5cb9c34ceb8226597605a49638bee7cec", "rev": "7bc18ebbed409ace4665ec9c9910b2837834b03d",
"sha256": "17dysdgkwv1hgi95zv5rrkxn21rbp5jyb8w2grgh93nmw7psmlwf", "sha256": "1jn9jfliymvh8s7szzsybkhm4z3g7bw2zvc15k5waskn4zw07pph",
"type": "tarball", "type": "tarball",
"url": "https://github.com/emacs-straight/org-mode/archive/a1e5bee5cb9c34ceb8226597605a49638bee7cec.tar.gz", "url": "https://github.com/emacs-straight/org-mode/archive/7bc18ebbed409ace4665ec9c9910b2837834b03d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"org-yt": { "org-yt": {
@ -143,6 +167,18 @@
"url": "https://github.com/arnested/php-extras/archive/d410c5af663c30c01d461ac476d1cbfbacb49367.tar.gz", "url": "https://github.com/arnested/php-extras/archive/d410c5af663c30c01d461ac476d1cbfbacb49367.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"reveal.js": {
"branch": "master",
"description": "The HTML Presentation Framework",
"homepage": "https://revealjs.com",
"owner": "hakimel",
"repo": "reveal.js",
"rev": "15815efe05ca69c35ce66cfdbf93316e1db66ecb",
"sha256": "1g3h710rhpyq4vnh6rgyay2dyjpw4rw99p062yhwhgrjkgjyzrc2",
"type": "tarball",
"url": "https://github.com/hakimel/reveal.js/archive/15815efe05ca69c35ce66cfdbf93316e1db66ecb.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rotate-text.el": { "rotate-text.el": {
"branch": "master", "branch": "master",
"description": "Emacs: cycle through words, symbols and patterns", "description": "Emacs: cycle through words, symbols and patterns",

View File

@ -19,6 +19,10 @@ self: super: {
''; '';
}; };
explain-pause-mode = self.straightBuild {
pname = "explain-pause-mode";
};
evil-markdown = self.straightBuild { evil-markdown = self.straightBuild {
pname = "evil-markdown"; pname = "evil-markdown";
}; };
@ -38,6 +42,10 @@ self: super: {
''; '';
}); });
nose = self.straightBuild {
pname = "nose";
};
org-mode = self.straightBuild rec { org-mode = self.straightBuild rec {
pname = "org-mode"; pname = "org-mode";
version = "9.4"; version = "9.4";
@ -63,6 +71,18 @@ self: super: {
pname = "php-extras"; pname = "php-extras";
}; };
revealjs = self.straightBuild {
pname = "reveal.js";
ename = "revealjs";
installPhase = ''
LISPDIR=$out/share/emacs/site-lisp
install -d $LISPDIR
cp -r * $LISPDIR
'';
};
rotate-text = self.straightBuild { rotate-text = self.straightBuild {
pname = "rotate-text.el"; pname = "rotate-text.el";
ename = "rotate-text"; ename = "rotate-text";