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"; + }; } ); }