Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created October 15, 2017 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell-wk/0395a5012f42d744aaaf1c301262da2e to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/0395a5012f42d744aaaf1c301262da2e to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }:
with builtins;
let
buildEnv = { buildInputs = [pkgs.emacs25-nox]; };
buildPath = (pkgs.runCommand "init" buildEnv ''
mkdir -p $out;
ln -s "${./init.org}" ./init.org;
emacs -Q --script "${assets/org-build.el}" -f make-init-el;
cp init.el $out/init.el;
'').outPath;
docsEnv = { buildInputs = [pkgs.emacs25-nox]; };
docsPath = (pkgs.runCommand "docs" docsEnv ''
mkdir -p $out;
ln -s "${buildPath}/init.el" ./init.el;
ln -s "${./init.org}" ./init.org;
emacs -Q --script "${assets/org-export.el}" -f generate-doc-files;
ls -la;
'').outPath;
in {
programs.emacs = {
enable = true;
package = pkgs.emacs;
extraPackages = epkgs: [
epkgs.badger-theme
];
};
home.file.".emacs.d/init.el".source = "${buildPath}/init.el";
home.file.".emacs.d/blah".text = "${docsPath}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment