nix: pass through exec arguments
Some checks failed
Test / Create distribution (push) Successful in 26s
Test / Fpkg (push) Successful in 33s
Test / Fortify (push) Successful in 39s
Test / Data race detector (push) Successful in 39s
Test / Flake checks (push) Failing after 55s

This is useful for when a wrapper script is unnecessary.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-03-27 01:08:53 +09:00
parent 2a4e2724a3
commit 21646d382b
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 21 additions and 3 deletions

View File

@ -88,11 +88,11 @@ in
conf = { conf = {
inherit (app) id; inherit (app) id;
path = pkgs.writeScript "${app.name}-start" '' path = if app.path == null then pkgs.writeScript "${app.name}-start" ''
#!${pkgs.zsh}${pkgs.zsh.shellPath} #!${pkgs.zsh}${pkgs.zsh.shellPath}
${script} ${script}
''; '' else app.path;
args = [ "${app.name}-start" ]; args = if app.args == null then [ "${app.name}-start" ] else app.args;
confinement = { confinement = {
app_id = aid; app_id = aid;

View File

@ -94,6 +94,24 @@ in
''; '';
}; };
path = mkOption {
type = nullOr str;
default = null;
description = ''
Custom executable path.
Setting this to null will default to the start script.
'';
};
args = mkOption {
type = nullOr (listOf str);
default = null;
description = ''
Custom args.
Setting this to null will default to script name.
'';
};
script = mkOption { script = mkOption {
type = nullOr str; type = nullOr str;
default = null; default = null;