A better Rust ATProto crate

update ci and formatting

Orual 5aad02ae 9d9a92c7

Changed files
+75 -72
.tangled
workflows
crates
jacquard-common
src
types
nix
+1 -1
.tangled/workflows/build.yml
··· 6 6 7 7 dependencies: 8 8 nixpkgs: 9 - - just 9 + #- just 10 10 11 11 steps: 12 12 - name: build appview
+1
crates/jacquard-common/src/types/nsid.rs
··· 1 +
+3 -3
flake.nix
··· 14 14 }; 15 15 16 16 outputs = inputs: 17 - inputs.flake-parts.lib.mkFlake {inherit inputs;} { 17 + inputs.flake-parts.lib.mkFlake { inherit inputs; } { 18 18 systems = import inputs.systems; 19 19 20 20 # See ./nix/modules/*.nix for the modules that are imported here. 21 21 imports = with builtins; 22 22 map 23 - (fn: ./nix/modules/${fn}) 24 - (attrNames (readDir ./nix/modules)); 23 + (fn: ./nix/modules/${fn}) 24 + (attrNames (readDir ./nix/modules)); 25 25 }; 26 26 }
+21 -21
nix/modules/devshell.nix
··· 1 - {inputs, ...}: { 2 - perSystem = { 3 - config, 4 - self', 5 - pkgs, 6 - lib, 7 - ... 8 - }: { 9 - devShells.default = pkgs.mkShell { 10 - name = "jacquard-shell"; 11 - inputsFrom = [ 12 - self'.devShells.rust 13 - config.pre-commit.devShell # See ./nix/modules/pre-commit.nix 14 - ]; 15 - packages = with pkgs; [ 16 - just 17 - nixd # Nix language server 18 - bacon 19 - rust-analyzer 20 - ]; 1 + { inputs, ... }: { 2 + perSystem = 3 + { config 4 + , self' 5 + , pkgs 6 + , lib 7 + , ... 8 + }: { 9 + devShells.default = pkgs.mkShell { 10 + name = "jacquard-shell"; 11 + inputsFrom = [ 12 + self'.devShells.rust 13 + config.pre-commit.devShell # See ./nix/modules/pre-commit.nix 14 + ]; 15 + packages = with pkgs; [ 16 + just 17 + nixd # Nix language server 18 + bacon 19 + rust-analyzer 20 + ]; 21 + }; 21 22 }; 22 - }; 23 23 }
+49 -47
nix/modules/rust.nix
··· 1 - {inputs, ...}: { 1 + { inputs, ... }: { 2 2 imports = [ 3 3 inputs.rust-flake.flakeModules.default 4 4 inputs.rust-flake.flakeModules.nixpkgs 5 5 # inputs.process-compose-flake.flakeModule 6 6 # inputs.cargo-doc-live.flakeModule 7 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 - }; 8 + perSystem = 9 + { config 10 + , self' 11 + , pkgs 12 + , lib 13 + , ... 14 + }: 15 + let 16 + inherit (pkgs.stdenv) isDarwin; 17 + inherit (pkgs.darwin) apple_sdk; 22 18 23 - # Common build inputs for all crates 24 - commonBuildInputs = lib.optionals isDarwin ( 25 - with apple_sdk.frameworks; [ 26 - IOKit 27 - Security 28 - SystemConfiguration 29 - ] 30 - ); 31 - in { 32 - rust-project = { 33 - # Source filtering to avoid unnecessary rebuilds 34 - src = lib.cleanSourceWith { 35 - src = inputs.self; 36 - filter = config.rust-project.crane-lib.filterCargoSources; 19 + # Common configuration for all crates 20 + globalCrateConfig = { 21 + crane.clippy.enable = false; 37 22 }; 38 - crates = { 39 - "jacquard" = { 40 - imports = [globalCrateConfig]; 41 - autoWire = ["crate" "clippy"]; 42 - path = ./../../crates/jacquard; 43 - crane = { 44 - args = { 45 - buildInputs = commonBuildInputs; 23 + 24 + # Common build inputs for all crates 25 + commonBuildInputs = lib.optionals isDarwin ( 26 + with apple_sdk.frameworks; [ 27 + IOKit 28 + Security 29 + SystemConfiguration 30 + ] 31 + ); 32 + in 33 + { 34 + rust-project = { 35 + # Source filtering to avoid unnecessary rebuilds 36 + src = lib.cleanSourceWith { 37 + src = inputs.self; 38 + filter = config.rust-project.crane-lib.filterCargoSources; 39 + }; 40 + crates = { 41 + "jacquard" = { 42 + imports = [ globalCrateConfig ]; 43 + autoWire = [ "crate" "clippy" ]; 44 + path = ./../../crates/jacquard; 45 + crane = { 46 + args = { 47 + buildInputs = commonBuildInputs; 48 + }; 46 49 }; 47 50 }; 48 - }; 49 51 50 - "jacquard-common" = { 51 - imports = [globalCrateConfig]; 52 - autoWire = ["crate" "clippy"]; 53 - path = ./../../crates/jacquard-common; 54 - crane = { 55 - args = { 56 - buildInputs = commonBuildInputs; 52 + "jacquard-common" = { 53 + imports = [ globalCrateConfig ]; 54 + autoWire = [ "crate" "clippy" ]; 55 + path = ./../../crates/jacquard-common; 56 + crane = { 57 + args = { 58 + buildInputs = commonBuildInputs; 59 + }; 57 60 }; 58 61 }; 59 62 }; 60 63 }; 64 + packages.default = self'.packages.jacquard; 61 65 }; 62 - packages.default = self'.packages.jacquard; 63 - }; 64 66 }