Something went wrong. Try again.
Parakeet is a Rust-based Bluesky AppServer aiming to implement most of the functionality required to support the Bluesky client
appview atproto bluesky rust appserver
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147{ description = "Parakeet - a Rust-based Bluesky AppView for Bluesky client";
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; crane.url = "github:ipetkov/crane"; flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; };
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; overlays = [ (import rust-overlay) ]; };
inherit (pkgs) lib; inherit (lib.fileset) toSource unions union;
craneLib = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.stable.latest.default); src = toSource { root = ./.; fileset = unions [ (craneLib.fileset.commonCargoSources ./.) ]; };
commonArgs = { inherit src; strictDeps = true;
nativeBuildInputs = with pkgs; [ pkg-config ]; buildInputs = with pkgs; [ clang libclang openssl protobuf ];
CLANG_PATH = "${pkgs.clang}/bin/clang"; LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; PROTOC = "${pkgs.protobuf}/bin/protoc"; PROTOC_INCLUDE = "${pkgs.protobuf}/include"; BUILD_GIT_REV = self.shortRev or self.dirtyShortRev; };
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
individualCrateArgs = commonArgs // { inherit cargoArtifacts; inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; doCheck = false; };
fileSetForCrate = crate: add: toSource { root = ./.; fileset = union (unions [ ./Cargo.lock ./Cargo.toml (craneLib.fileset.commonCargoSources ./crates/lexica) (craneLib.fileset.commonCargoSources ./crates/parakeet-db) (craneLib.fileset.commonCargoSources ./crates/parakeet-index) ./crates/parakeet-index/proto (craneLib.fileset.commonCargoSources crate) ]) add; };
parakeet-appview = craneLib.buildPackage ( individualCrateArgs // { pname = "parakeet"; cargoExtraArgs = "-p parakeet"; src = fileSetForCrate ./crates/parakeet (unions [ ./migrations (craneLib.fileset.commonCargoSources ./crates/dataloader-rs) (craneLib.fileset.commonCargoSources ./crates/parakeet) ./crates/parakeet/src/sql ]); } );
parakeet-consumer = craneLib.buildPackage ( individualCrateArgs // { pname = "consumer"; cargoExtraArgs = "-p consumer"; src = fileSetForCrate ./crates/consumer (unions [ ./crates/consumer/src/db/sql ]); } );
parakeet-index = craneLib.buildPackage ( individualCrateArgs // { pname = "parakeet-index"; cargoExtraArgs = "-p parakeet-index --features server"; src = fileSetForCrate ./crates/parakeet-index (unions [ ]); } ); in { packages = { default = parakeet-appview; inherit parakeet-appview parakeet-consumer parakeet-index; };
apps = { parakeet-appview = flake-utils.lib.mkApp { drv = parakeet-appview; }; parakeet-consumer = flake-utils.lib.mkApp { drv = parakeet-consumer; }; parakeet-index = flake-utils.lib.mkApp { drv = parakeet-index; }; };
devShells.default = craneLib.devShell { packages = with pkgs; [ diesel-cli protobuf tombi typos ]; }; } ) // flake-utils.lib.eachDefaultSystemPassThrough (system: { nixosModules = { default = import ./nix/services.nix { inherit system; parakeetSelf = self; }; }; });}