diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8470fac --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +/result +/result-* diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4e05f67 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778430510, + "narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8bd7c19 --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ + description = "hyperhive — multi-Claude-Code-agent orchestration on nixos-containers"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + inputs@{ + self, + nixpkgs, + treefmt-nix, + }: + let + inherit (nixpkgs) lib; + systems = [ + "aarch64-linux" + "x86_64-linux" + ]; + treefmt-config = { + projectRootFile = "flake.nix"; + programs = { + keep-sorted.enable = true; + nixfmt.enable = true; + rustfmt.enable = true; + }; + }; + forAllSystems = + f: + lib.genAttrs systems ( + system: + f rec { + inherit system; + pkgs = nixpkgs.legacyPackages.${system}; + treefmt-eval = treefmt-nix.lib.evalModule pkgs treefmt-config; + } + ); + in + { + devShells = forAllSystems ( + { pkgs, ... }: + { + default = pkgs.mkShell { + packages = with pkgs; [ + cargo + clippy + pkg-config + rust-analyzer + rustc + rustfmt + ]; + }; + } + ); + + formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); + + checks = forAllSystems ( + { treefmt-eval, ... }: + { + formatting = treefmt-eval.config.build.check self; + } + ); + }; +}