nix run
This commit is contained in:
25
flake.nix
25
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";
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user