From 13fcb19bf9ac33c69e3a295c5d9b04d694e4c8e1 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib.nix b/lib.nix index e9aef82..5820c83 100644 --- a/lib.nix +++ b/lib.nix @@ -17,7 +17,15 @@ rec { }; # make a template with placeholders from a text - templateText = { name, text, outPath, translations ? {} }: + templateText = { + name, + text, + outPath, + owner ? "root", + group ? "", + mode ? "0400", + translations ? {}, + }: pkgs.runCommand name { textBeforeTemplate = text; script = '' @@ -30,6 +38,8 @@ rec { 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} ''; # make a template with placeholders from a file