aboutsummaryrefslogtreecommitdiff
path: root/day2/ex1-hello-world/solution.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2022-10-06 10:21:34 +1100
committerJustin Bedo <cu@cua0.org>2022-10-07 14:58:01 +1100
commitdda29ca7685d360d5428dd827d11a9e4139a0872 (patch)
tree0dcc853fd90abf245b6ba0a7506b2e1093bf7800 /day2/ex1-hello-world/solution.nix
init
Diffstat (limited to 'day2/ex1-hello-world/solution.nix')
-rw-r--r--day2/ex1-hello-world/solution.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/day2/ex1-hello-world/solution.nix b/day2/ex1-hello-world/solution.nix
new file mode 100644
index 0000000..d0531a2
--- /dev/null
+++ b/day2/ex1-hello-world/solution.nix
@@ -0,0 +1,24 @@
+/*
+ This first exercise demonstrates how to define a processing stage,
+which is just instructions on how to compute an output (the
+`buildCommand`) from some inputs (in this case, there are no inputs).
+Each stage must minimally define a `name`, shell code to build the
+output in `buildCommand`, and any software that's required in
+`buildInputs`. Note that `buildInputs = []` if not defined, meaning no
+extra requirements over the standard environment.
+
+Try replacing the echo below with output from the GNU hello program.
+Hint: the GNU hello program is available at `pkgs.hello` and the
+executable is called `hello`.
+*/
+{bionix}:
+with bionix;
+ stage {
+ name = "hello-world";
+
+ buildInputs = [pkgs.hello];
+
+ buildCommand = ''
+ hello > $out
+ '';
+ }