mv executable

This commit is contained in:
Kiara Grouwstra 2025-08-11 15:18:37 +02:00
parent 0e9fb00940
commit dfac12a864
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -12,7 +12,7 @@
text, text,
outPath, outPath,
owner ? "root", owner ? "root",
group ? "", group ? owner,
mode ? "0400", mode ? "0400",
}: }:
pkgs.runCommand name { pkgs.runCommand name {
@ -20,6 +20,8 @@
script = '' script = ''
#!/bin/sh #!/bin/sh
${nix_templater}/bin/nix_templater ${builtins.placeholder "out"}/template ${builtins.placeholder "nix_template"} "${outPath}" ${nix_templater}/bin/nix_templater ${builtins.placeholder "out"}/template ${builtins.placeholder "nix_template"} "${outPath}"
chown ${owner}:${group} "${outPath}"
chmod ${mode} "${outPath}"
''; '';
passAsFile = [ "script" "textBeforeTemplate" ]; passAsFile = [ "script" "textBeforeTemplate" ];
} '' } ''
@ -27,7 +29,5 @@
cp $textBeforeTemplatePath $out/template cp $textBeforeTemplatePath $out/template
cp $scriptPath $out/bin/${name} cp $scriptPath $out/bin/${name}
chmod +x $out/bin/${name} chmod +x $out/bin/${name}
chown ${owner}:${group} $out/bin/${name}
chmod ${mode} $out/bin/${name}
''; '';
} }