Last active
October 18, 2017 21:56
-
-
Save LnL7/602f3f3e51819e4433fcdd594ac58389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, ... }: | |
with lib; | |
let | |
cfg = config.programs.emacs.org-build; | |
in | |
{ | |
options.programs.emacs.org-build = { | |
enable = mkEnableOption "Build init.el from Orgmode file"; | |
source = mkOption { | |
type = types.path; | |
description = '' | |
The source orgfile to build as init.el | |
''; | |
}; | |
}; | |
config = mkIf cfg.enable { | |
home.file.".emacs.d/init.el".source = import ./release.nix { | |
inherit pkgs; | |
ssource = cfg.source; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
# Import hm-org-build channel. | |
# sudo nix-channel --add https://github.com/dustinlacewell/nix-hm-org-build/archive/master.tar.gz hm-org-build | |
# sudo nix-channel --update | |
{ | |
# Import org-build modules. | |
imports = [ <hm-org-build> ]; | |
programs.emacs.enable = true; | |
programs.emacs.org-build.enable = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, source ? ./. }: | |
rec { | |
build = let | |
# the build uses emacs to perform the conversion | |
env = { buildInputs = [ pkgs.emacs ]; }; | |
# call make-init-el to convert the file | |
script = '' | |
ln -s "${source}" ./init.org; | |
emacs -Q --script "${./org-build.el}" -f make-init-el; | |
cp ./init.el $out; | |
''; | |
in pkgs.runCommand "org-build" env script; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment