From f165263296cd79e4d770d23f2b6b15b3b7947ea9 Mon Sep 17 00:00:00 2001 From: Tilman Baumann Date: Sun, 15 Mar 2026 15:40:22 +0100 Subject: [PATCH] test merge * Feat: Add Nix support Adding Nix support. Nixos modules may follow... Run directly with `nix run github:RightNow-AI/openfang` There are a bunch of flake outputs (based on cargo workspace) Focus on these: * openfang-cli (default) * openfang-desktop * nix: cmake depdencency was introduced via llama * Follow upstream style --- flake.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..f172a0a0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ + description = "The OpenFang Agent OS"; + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + rust-flake.url = "github:juspay/rust-flake"; + }; + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + inputs.rust-flake.flakeModules.default + inputs.rust-flake.flakeModules.nixpkgs + ]; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + lib, + ... + }: { + rust-project.src = lib.sources.cleanSource ./.; + rust-project.defaults.perCrate.crane.args.buildInputs = with pkgs; [ + clang + openssl + pkg-config + ]; + rust-project.crates.openfang-desktop.crane.args.buildInputs = with pkgs; [ + atk + glib + gtk3 + openssl + pkg-config + webkitgtk_4_1 + ]; + + packages.default = self'.packages.openfang-cli; + apps = { + openfang-cli = { + program = "${self'.packages.openfang-cli}/bin/openfang"; + meta.description = "CLI tool for the OpenFang Agent OS"; + }; + openfang-desktop = { + program = "${self'.packages.openfang-desktop}/bin/openfang-desktop"; + meta.description = "Native desktop application for the OpenFang Agent OS (Tauri 2.0)"; + }; + default = self'.apps.openfang-cli; + }; + }; + flake = { + }; + }; +}