Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
dfac12a864
mv executable 2025-08-11 15:38:10 +02:00
0e9fb00940
set file rights 2025-08-11 15:11:29 +02:00

11
lib.nix
View file

@ -7,12 +7,21 @@
};
# make a template with placeholders
template_text = { name, text, outPath }:
template_text = {
name,
text,
outPath,
owner ? "root",
group ? owner,
mode ? "0400",
}:
pkgs.runCommand name {
textBeforeTemplate = text;
script = ''
#!/bin/sh
${nix_templater}/bin/nix_templater ${builtins.placeholder "out"}/template ${builtins.placeholder "nix_template"} "${outPath}"
chown ${owner}:${group} "${outPath}"
chmod ${mode} "${outPath}"
'';
passAsFile = [ "script" "textBeforeTemplate" ];
} ''