expose applyTemplate and add docs

This commit is contained in:
jacekpoz 2024-09-13 11:17:33 +02:00
parent 3565101316
commit c0b6df99d8
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 6 additions and 2 deletions

View file

@ -113,7 +113,11 @@ mkDerivation {
in that case if you wish to replicate the functionality of `extraFiles` you can use the derivation's `installPhase`, manually `mkdir` the needed directories and `cp` your files into `$out`
nte offers a standard library that contains `nixpkgs`, a `getEntry` function that gives you access to the entry's attributes and utility functions found in [stdlib.nix](./stdlib.nix)
nte offers a standard library that contains:
- `nixpkgs`
- `getEntry` - a function that gives you access to the entry's attributes
- `applyTemplate` - a function that allows you to manually apply a template to an entry
- utility functions found in [stdlib.nix](./stdlib.nix)
## templates

View file

@ -8,7 +8,7 @@ pkgs: src: {extraArgs, entries, templates}: let
inherit (lib.strings) concatMapStrings concatStrings escapeShellArg hasSuffix isString removeSuffix;
inherit (lib.trivial) functionArgs;
args = {inherit pkgs getEntry;}
args = {inherit pkgs getEntry applyTemplate;}
// (import ./stdlib.nix pkgs)
// extraArgs;