-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathorg-agenda-api.nix
More file actions
37 lines (33 loc) · 1.14 KB
/
Copy pathorg-agenda-api.nix
File metadata and controls
37 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# org-agenda-api.nix - Tangled org-config for org-agenda-api container
{
pkgs,
inputs,
system,
}: let
# Path to org-config.org in the dotfiles
orgConfigOrg = ../dotfiles/emacs.d/org-config.org;
# Tangle org-config.org to produce elisp files
orgAgendaCustomConfig =
pkgs.runCommand "org-agenda-custom-config" {
buildInputs = [pkgs.emacs-nox];
} ''
mkdir -p $out
mkdir -p work
# Copy org file to writable location (tangle writes to same directory)
cp ${orgConfigOrg} work/org-config.org
# Tangle org-config.org
emacs --batch \
--eval '(require (quote org))' \
--eval '(org-babel-tangle-file "work/org-config.org")'
# Copy all tangled files to output, stripping :straight keywords
# (straight.el is not available in the minimal container Emacs)
for f in work/org-config-*.el; do
if [ -f "$f" ]; then
# Remove :straight nil and :straight t from use-package declarations
sed -e 's/:straight nil//g' -e 's/:straight t//g' "$f" > "$out/$(basename "$f")"
fi
done
'';
in {
org-agenda-custom-config = orgAgendaCustomConfig;
}