diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5e0c19d --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + description = "Ambient miner proxy"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = + { + self, + nixpkgs, + }: + let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + serviceModule = import ./nix/module.nix { inherit self; }; + forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems; + + in + { + devShells = forEachSupportedSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + default = pkgs.mkShell { + packages = with pkgs; [ + plan9port + bun + nodejs_24 + typescript-language-server + ]; + }; + } + ); + + formatter = forEachSupportedSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + pkgs.nixfmt-rfc-style + ); + + nixosModules = { + default = serviceModule; + miner-proxy = serviceModule; + }; + }; +}