mirror of
https://github.com/emacs-twist/org-babel.git
synced 2025-03-05 16:27:07 +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:
parent
b18f271e40
commit
d3c44b7fec
2 changed files with 12 additions and 5 deletions
13
flake.nix
13
flake.nix
|
@ -1,5 +1,16 @@
|
||||||
{
|
{
|
||||||
description = "Nix library for extracting source blocks from Org";
|
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));
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,9 @@ let
|
||||||
builtins.any (t: matchOrgHeadline t s) headlines;
|
builtins.any (t: matchOrgHeadline t s) headlines;
|
||||||
|
|
||||||
tangleOrgBabel = import ./tangleOrgBabel.nix;
|
tangleOrgBabel = import ./tangleOrgBabel.nix;
|
||||||
|
|
||||||
tangleOrgBabelFile = name: path: options:
|
|
||||||
toFile name (tangleOrgBabel options (readFile path));
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit matchOrgTag matchOrgHeadline matchOrgHeadlines;
|
inherit matchOrgTag matchOrgHeadline matchOrgHeadlines;
|
||||||
inherit excludeOrgSubtreesOnHeadlines;
|
inherit excludeOrgSubtreesOnHeadlines;
|
||||||
inherit tangleOrgBabel;
|
inherit tangleOrgBabel;
|
||||||
inherit tangleOrgBabelFile;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue