From 0e9fb009409150b58491873094597aa8197c4b70 Mon Sep 17 00:00:00 2001 From: cinereal Date: Mon, 11 Aug 2025 14:43:03 +0200 Subject: [PATCH] set file rights --- lib.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib.nix b/lib.nix index 16b1791..e8b36fe 100644 --- a/lib.nix +++ b/lib.nix @@ -7,7 +7,14 @@ }; # make a template with placeholders - template_text = { name, text, outPath }: + template_text = { + name, + text, + outPath, + owner ? "root", + group ? "", + mode ? "0400", + }: pkgs.runCommand name { textBeforeTemplate = text; script = '' @@ -20,5 +27,7 @@ cp $textBeforeTemplatePath $out/template cp $scriptPath $out/bin/${name} chmod +x $out/bin/${name} + chown ${owner}:${group} $out/bin/${name} + chmod ${mode} $out/bin/${name} ''; }