From 354d3b707c85b819009bc1fa8ea90572b3afefeb Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Sat, 31 Jan 2026 18:56:51 +0100 Subject: [PATCH] nix run --- flake.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 933cb96..44b67f8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Odin devshell"; + description = "Odin GA with plotting"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -25,6 +25,29 @@ uiua-unstable ]; }; + + packages.default = pkgs.writeShellScriptBin "run-ga" '' + set -e + mkdir -p output + + echo "Building Odin GA..." + odin build src -out:ga + + echo "Running GA..." + ./ga + + echo "Generating plot..." + ${pkgs.uiua-unstable}/bin/uiua src/plot.ua + + echo "Done! Plot saved to output/plot.png" + + rm ga + ''; + + apps.default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/run-ga"; + }; } ); }