document components

This commit is contained in:
Kiara Grouwstra 2025-05-28 22:56:15 +02:00
parent 5189feae3a
commit f76e2e42fe
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
3 changed files with 4 additions and 0 deletions

View file

@ -1,10 +1,12 @@
{ pkgs, nix_templater }:
rec {
# placeholder to be substituted with the content of a secret file
fileContents = file: {
outPath = "<${builtins.placeholder "nix_template"}${toString file}${builtins.placeholder "nix_template"}>";
file = file;
};
# make a template with placeholders
template_text = { name, text, outPath }:
pkgs.runCommand name {
textBeforeTemplate = text;

View file

@ -1,3 +1,4 @@
# replace occurrences of a magic string in a template file
import sys
from pathlib import Path

View file

@ -1,3 +1,4 @@
# test injecting a secret into a template
{ legacyPackages, system, nixpkgs }:
let
# this file would usually be outside of the store