1
0
Fork 0
mirror of https://github.com/emacs-twist/org-babel.git synced 2025-03-05 08:17:05 +00:00

fix!: Provide the file writer in an overlay

builtins.toFile doesn't work in pure evaluation mode. It must use
a function from nixpkgs, so it should be provided in an overlay.
This commit is contained in:
Akira Komamura 2021-12-12 05:18:46 +09:00
parent b18f271e40
commit d3c44b7fec
2 changed files with 12 additions and 5 deletions

View file

@ -1,5 +1,16 @@
{
description = "Nix library for extracting source blocks from Org";
outputs = { ... }: { lib = import ./nix; };
outputs = { ... }:
let
lib = import ./nix;
in
{
inherit lib;
overlay = _: pkgs: {
tangleOrgBabelFile = name: path: options:
pkgs.writeText name
(lib.tangleOrgBabel options (builtins.readFile path));
};
};
}

View file

@ -8,13 +8,9 @@ let
builtins.any (t: matchOrgHeadline t s) headlines;
tangleOrgBabel = import ./tangleOrgBabel.nix;
tangleOrgBabelFile = name: path: options:
toFile name (tangleOrgBabel options (readFile path));
in
{
inherit matchOrgTag matchOrgHeadline matchOrgHeadlines;
inherit excludeOrgSubtreesOnHeadlines;
inherit tangleOrgBabel;
inherit tangleOrgBabelFile;
}