summaryrefslogtreecommitdiff
path: root/trivionomicon/templates/system-flake/pkgs/hello-world
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-08-24 15:48:29 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-24 15:48:29 -0600
commitecab16d635554150627403675642d5603ef64cc6 (patch)
treef94619061973fc0a5fd6097e27e80a5dde627fda /trivionomicon/templates/system-flake/pkgs/hello-world
parent0e11a692f223b268ca0d208b0ebf48c80caddfb6 (diff)
parent53a923158861a9c52b86f37d826c3f4637476dfa (diff)
Add 'trivionomicon/' from commit 'c651b8c4706cfc750303db12ae19e58164a6bebb'
git-subtree-dir: trivionomicon git-subtree-mainline: 02d3ab9583983e823909020c34b9d5a6894fb773 git-subtree-split: c651b8c4706cfc750303db12ae19e58164a6bebb
Diffstat (limited to 'trivionomicon/templates/system-flake/pkgs/hello-world')
-rw-r--r--trivionomicon/templates/system-flake/pkgs/hello-world/Makefile6
-rw-r--r--trivionomicon/templates/system-flake/pkgs/hello-world/default.nix14
-rw-r--r--trivionomicon/templates/system-flake/pkgs/hello-world/hello-world.c7
3 files changed, 27 insertions, 0 deletions
diff --git a/trivionomicon/templates/system-flake/pkgs/hello-world/Makefile b/trivionomicon/templates/system-flake/pkgs/hello-world/Makefile
new file mode 100644
index 0000000..4eef056
--- /dev/null
+++ b/trivionomicon/templates/system-flake/pkgs/hello-world/Makefile
@@ -0,0 +1,6 @@
+CFLAGS += -O3 -s
+
+all: hello-world
+
+%: %.c
+ $(CC) $(CFLAGS) -o $@ $<
diff --git a/trivionomicon/templates/system-flake/pkgs/hello-world/default.nix b/trivionomicon/templates/system-flake/pkgs/hello-world/default.nix
new file mode 100644
index 0000000..19047a1
--- /dev/null
+++ b/trivionomicon/templates/system-flake/pkgs/hello-world/default.nix
@@ -0,0 +1,14 @@
+{stdenv, ...}:
+stdenv.mkDerivation {
+ name = "hello-world";
+ version = "1.0.0";
+
+ src = ./.;
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cp hello-world $out/bin
+ '';
+
+ meta.mainProgram = "hello-world";
+}
diff --git a/trivionomicon/templates/system-flake/pkgs/hello-world/hello-world.c b/trivionomicon/templates/system-flake/pkgs/hello-world/hello-world.c
new file mode 100644
index 0000000..d6cfa6b
--- /dev/null
+++ b/trivionomicon/templates/system-flake/pkgs/hello-world/hello-world.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main()
+{
+ printf("Hello, world!\n");
+ return 0;
+}