54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
{
|
|
description = "Odin GA with plotting";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
odin
|
|
ols
|
|
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";
|
|
};
|
|
}
|
|
);
|
|
}
|