diff --git a/advice.el b/advice.el index 82f2d96..675b0fc 100644 --- a/advice.el +++ b/advice.el @@ -7,15 +7,22 @@ ;;; 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 - :before (lambda (&rest r) + :around (lambda (orig-fn &rest r) (message "[nix-doom-emacs] Advising doom installer to gather packages to install...") (advice-add 'doom-autoloads-reload :override (lambda (&optional file force-p) (message "[nix-doom-emacs] Skipping generating autoloads..."))) (advice-add 'doom--print :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 :override (lambda (q) diff --git a/default.nix b/default.nix index bb6e1d7..4048a21 100644 --- a/default.nix +++ b/default.nix @@ -49,6 +49,7 @@ , runCommand , fetchFromGitHub , substituteAll +, writeShellScript , writeShellScriptBin , writeTextDir }: @@ -171,11 +172,25 @@ let in (emacsPackages.emacsWithPackages (epkgs: [ 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 emacs.overrideAttrs (esuper: let cmd = '' 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 # emacsWithPackages assumes share/emacs/site-lisp/subdirs.el # 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 rm -rf $out/share ln -s ${esuper.emacs}/share $out + ${build-summary} ''; in if esuper ? buildCommand then diff --git a/nix/sources.json b/nix/sources.json index 472081c..e2c7835 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -167,6 +167,18 @@ "url": "https://github.com/arnested/php-extras/archive/d410c5af663c30c01d461ac476d1cbfbacb49367.tar.gz", "url_template": "https://github.com///archive/.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///archive/.tar.gz" + }, "rotate-text.el": { "branch": "master", "description": "Emacs: cycle through words, symbols and patterns", diff --git a/overrides.nix b/overrides.nix index ccae250..e59f414 100644 --- a/overrides.nix +++ b/overrides.nix @@ -71,6 +71,18 @@ self: super: { 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 { pname = "rotate-text.el"; ename = "rotate-text";