An easy-to-host PDS on the ATProtocol, MacOS. Grandma-approved.

feat(MM-65): add nix build output for relay binary using crane

- Add packages.relay output to flake.nix using crane's two-phase build
(buildDepsOnly → buildPackage) for cached dependency derivations
- Add crane input; pin via flake.lock
- Pass sqlite + pkg-config + LIBSQLITE3_SYS_USE_PKG_CONFIG=1 so rusqlite
links correctly, mirroring the devenv setup
- Set pname = "relay" to silence workspace Cargo.toml name warning
- packages.default = relay so bare `nix build` works too

Closes MM-65

+49 -1
+16
flake.lock
··· 33 33 "type": "github" 34 34 } 35 35 }, 36 + "crane": { 37 + "locked": { 38 + "lastModified": 1772560058, 39 + "narHash": "sha256-NuVKdMBJldwUXgghYpzIWJdfeB7ccsu1CC7B+NfSoZ8=", 40 + "owner": "ipetkov", 41 + "repo": "crane", 42 + "rev": "db590d9286ed5ce22017541e36132eab4e8b3045", 43 + "type": "github" 44 + }, 45 + "original": { 46 + "owner": "ipetkov", 47 + "repo": "crane", 48 + "type": "github" 49 + } 50 + }, 36 51 "devenv": { 37 52 "inputs": { 38 53 "cachix": "cachix", ··· 298 313 }, 299 314 "root": { 300 315 "inputs": { 316 + "crane": "crane", 301 317 "devenv": "devenv", 302 318 "nixpkgs": "nixpkgs_2", 303 319 "rust-overlay": "rust-overlay",
+33 -1
flake.nix
··· 13 13 systems.url = "github:nix-systems/default"; 14 14 rust-overlay.url = "github:oxalica/rust-overlay"; 15 15 rust-overlay.inputs = { nixpkgs.follows = "nixpkgs"; }; 16 + crane.url = "github:ipetkov/crane"; 16 17 }; 17 18 18 - outputs = { self, nixpkgs, devenv, systems, rust-overlay, ... } @ inputs: 19 + outputs = { self, nixpkgs, devenv, systems, rust-overlay, crane, ... } @ inputs: 19 20 let 20 21 forEachSystem = f: nixpkgs.lib.genAttrs (import systems) f; 21 22 in { 23 + packages = forEachSystem (system: 24 + let 25 + pkgs = import nixpkgs { 26 + inherit system; 27 + overlays = [ (import rust-overlay) ]; 28 + }; 29 + rustToolchain = pkgs.rust-bin.stable.latest.default; 30 + craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; 31 + 32 + commonArgs = { 33 + src = craneLib.cleanCargoSource ./.; 34 + pname = "relay"; 35 + strictDeps = true; 36 + nativeBuildInputs = [ pkgs.pkg-config ]; 37 + buildInputs = [ pkgs.sqlite ]; 38 + LIBSQLITE3_SYS_USE_PKG_CONFIG = "1"; 39 + }; 40 + 41 + # Build deps separately so they're cached when only source changes. 42 + cargoArtifacts = craneLib.buildDepsOnly commonArgs; 43 + 44 + relay = craneLib.buildPackage (commonArgs // { 45 + inherit cargoArtifacts; 46 + cargoExtraArgs = "--package relay"; 47 + }); 48 + in { 49 + inherit relay; 50 + default = relay; 51 + } 52 + ); 53 + 22 54 devShells = forEachSystem (system: 23 55 let 24 56 pkgs = nixpkgs.legacyPackages.${system};