diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 64bdc8cf..efc8f130 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -33,6 +33,7 @@ sub begin :Private { $c->stash->{inputTypes} = { 'string' => 'String value', 'boolean' => 'Boolean', + 'nix' => 'Nix expression', 'build' => 'Build output', 'sysbuild' => 'Build output (same system)' }; diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 62232068..b9d7a297 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -157,7 +157,7 @@ sub fetchInput { elsif ($type eq "sysbuild") { @inputs = fetchInputSystemBuild($db, $project, $jobset, $name, $value); } - elsif ($type eq "string") { + elsif ($type eq "string" || $type eq "nix") { die unless defined $value; @inputs = { value => $value }; } @@ -241,6 +241,9 @@ sub inputsToArgs { when ("boolean") { push @res, "--arg", $input, booleanToString($exprType, $alt->{value}); } + when ("nix") { + push @res, "--arg", $input, $alt->{value}; + } default { push @res, "--arg", $input, buildInputToString($exprType, $alt); } diff --git a/src/root/common.tt b/src/root/common.tt index 5d4be232..7a52b48a 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -247,10 +247,12 @@ END; BLOCK renderShortInputValue; IF input.type == "build" || input.type == "sysbuild" %] [% input.dependency.id %] - [% ELSIF input.type == "string" || input.type == "boolean" %] - "[% input.value %]" + [% ELSIF input.type == "string" %] + "[% HTML.escape(input.value) %]" + [% ELSIF input.type == "nix" || input.type == "boolean" %] + [% HTML.escape(input.value) %] [% ELSE %] - [% input.uri %][% IF input.revision %] (r[% input.revision %])[% END %] + [% HTML.escape(input.uri) %][% IF input.revision %] (r[% HTML.escape(input.revision) %])[% END %] [% END %] [% END; @@ -292,13 +294,15 @@ BLOCK renderInputs; %]