A better Rust ATProto crate
at lifetimes 2.5 kB view raw
1{inputs, ...}: { 2 imports = [ 3 inputs.rust-flake.flakeModules.default 4 inputs.rust-flake.flakeModules.nixpkgs 5 # inputs.process-compose-flake.flakeModule 6 # inputs.cargo-doc-live.flakeModule 7 ]; 8 perSystem = { 9 config, 10 self', 11 pkgs, 12 lib, 13 ... 14 }: let 15 inherit (pkgs.stdenv) isDarwin; 16 inherit (pkgs.darwin) apple_sdk; 17 18 # Common configuration for all crates 19 globalCrateConfig = { 20 crane.clippy.enable = false; 21 }; 22 23 # Common build inputs for all crates 24 commonBuildInputs = with pkgs; 25 [ 26 ] 27 ++ lib.optionals 28 isDarwin ( 29 with apple_sdk.frameworks; [ 30 IOKit 31 Security 32 SystemConfiguration 33 ] 34 ); 35 in { 36 rust-project = { 37 # Source filtering to avoid unnecessary rebuilds 38 src = lib.cleanSourceWith { 39 src = inputs.self; 40 filter = config.rust-project.crane-lib.filterCargoSources; 41 }; 42 crates = { 43 "jacquard" = { 44 imports = [globalCrateConfig]; 45 autoWire = ["crate" "clippy"]; 46 path = ./../../crates/jacquard; 47 crane = { 48 args = { 49 buildInputs = commonBuildInputs; 50 }; 51 }; 52 }; 53 54 "jacquard-common" = { 55 imports = [globalCrateConfig]; 56 autoWire = ["crate" "clippy"]; 57 path = ./../../crates/jacquard-common; 58 crane = { 59 args = { 60 buildInputs = commonBuildInputs; 61 }; 62 }; 63 }; 64 "jacquard-derive" = { 65 imports = [globalCrateConfig]; 66 autoWire = ["crate" "clippy"]; 67 path = ./../../crates/jacquard-derive; 68 crane = { 69 args = { 70 buildInputs = commonBuildInputs; 71 }; 72 }; 73 }; 74 "jacquard-lexicon" = { 75 imports = [globalCrateConfig]; 76 autoWire = ["crate" "clippy"]; 77 path = ./../../crates/jacquard-lexicon; 78 crane = { 79 args = { 80 buildInputs = commonBuildInputs; 81 }; 82 }; 83 }; 84 "jacquard-api" = { 85 imports = [globalCrateConfig]; 86 autoWire = ["crate" "clippy"]; 87 path = ./../../crates/jacquard-api; 88 crane = { 89 args = { 90 buildInputs = commonBuildInputs; 91 }; 92 }; 93 }; 94 }; 95 }; 96 packages.default = self'.packages.jacquard; 97 }; 98}