summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix31
1 files changed, 25 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 7a028d0..843f9c5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,9 +3,13 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ agentd = {
+ url = "git+file:///home/ben/src/bsima/agentd";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
};
- outputs = { self, nixpkgs }:
+ outputs = { self, nixpkgs, agentd }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
@@ -16,19 +20,34 @@
ps.openai
ps.requests
]);
+
+ agent = pkgs.rustPlatform.buildRustPackage {
+ pname = "agent";
+ version = "0.1.0";
+ src = agentd;
+ cargoLock.lockFile = "${agentd}/Cargo.lock";
+ cargoBuildFlags = [ "-p" "agent" ];
+ doCheck = false;
+ };
in
{
devShells.${system}.default = pkgs.mkShell {
- buildInputs = [ pythonEnv ];
+ buildInputs = [ pythonEnv agent ];
shellHook = ''
echo "slopbot dev shell ready"
echo "Run: python main.py"
'';
};
- packages.${system}.default = pkgs.writeShellScriptBin "slopbot" ''
- cd /home/ben/src/bsima/slopbot
- exec ${pythonEnv}/bin/python ${./main.py}
- '';
+ packages.${system} = rec {
+ default = slopbot;
+ slopbot = pkgs.writeShellScriptBin "slopbot" ''
+ cd /home/ben/src/bsima/slopbot
+ export PATH=${agent}/bin:$PATH
+ export SLOPBOT_AGENT=${agent}/bin/agent
+ exec ${pythonEnv}/bin/python ${./main.py}
+ '';
+ inherit agent;
+ };
};
}