parses paypal soap logs

docs: update flake.nix and README.md with improved Nix support

- Restructure flake.nix to match standard Nix patterns
- Add support for multiple architectures (x86_64/aarch64, Linux/macOS)
- Add shell completion and man page generation
- Update README.md with installation instructions
- Improve development shell configuration

💙 Generated with Crush
Co-Authored-By: 💙 Crush <crush@charm.land>

dunkirk.sh ea4b58af 081634a5

verified
Changed files
+116 -48
+26 -1
README.md
··· 39 39 nix develop 40 40 ``` 41 41 42 + ### Using CMake 43 + 44 + ```bash 45 + # Build the project 46 + cmake -B build -S . 47 + cmake --build build --config Release 48 + 49 + # Run the parser 50 + ./build/soapdump payments.log 51 + ``` 52 + 53 + ### Installation 54 + 55 + Install directly from the flake: 56 + 57 + ```bash 58 + nix profile install github:taciturnaxolotl/soapdump 59 + ``` 60 + 61 + Or run without installing: 62 + 63 + ```bash 64 + nix run github:taciturnaxolotl/soapdump -- payments.log 65 + ``` 66 + 42 67 ## Output Format 43 68 44 69 Tab-separated values with the following fields: ··· 53 78 54 79 <p align="center"> 55 80 <a href="https://github.com/taciturnaxolotl/soapdump/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a> 56 - </p> 81 + </p>
+90 -47
flake.nix
··· 1 1 { 2 - description = "PayPal SOAP Log Parser"; 2 + description = "SoapDump - A high-performance PayPal SOAP log parser"; 3 3 4 4 inputs = { 5 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 - utils.url = "github:numtide/flake-utils"; 7 6 }; 8 7 9 - outputs = { self, nixpkgs, utils }: 10 - utils.lib.eachDefaultSystem (system: 11 - let 12 - pkgs = nixpkgs.legacyPackages.${system}; 13 - 14 - # Build dependencies 15 - buildInputs = with pkgs; [ 16 - cmake 17 - ]; 18 - 19 - # Development dependencies 20 - nativeBuildInputs = with pkgs; [ 21 - clang-tools 22 - bear 23 - ]; 24 - in 25 - { 26 - packages = rec { 8 + outputs = { self, nixpkgs, ... }: 9 + let 10 + allSystems = [ 11 + "x86_64-linux" # 64-bit Intel/AMD Linux 12 + "aarch64-linux" # 64-bit ARM Linux 13 + "x86_64-darwin" # 64-bit Intel macOS 14 + "aarch64-darwin" # 64-bit ARM macOS 15 + ]; 16 + forAllSystems = f: 17 + nixpkgs.lib.genAttrs allSystems ( 18 + system: 19 + f { 20 + pkgs = import nixpkgs { inherit system; }; 21 + } 22 + ); 23 + in 24 + { 25 + packages = forAllSystems ( 26 + { pkgs }: 27 + let 28 + version = if self ? rev then self.rev else "0.1.0"; 27 29 soapdump = pkgs.stdenv.mkDerivation { 28 30 pname = "soapdump"; 29 - version = "0.1.0"; 31 + inherit version; 32 + src = self; 30 33 31 - src = ./.; 32 - 33 - nativeBuildInputs = [ pkgs.clang ]; 34 + nativeBuildInputs = with pkgs; [ 35 + cmake 36 + clang 37 + installShellFiles 38 + ]; 34 39 35 40 buildPhase = '' 36 - mkdir -p bin 37 - clang++ -std=c++17 -O3 -o bin/soapdump src/soapdump.cpp 41 + cmake -B build -S . 42 + cmake --build build --config Release 38 43 ''; 39 44 40 45 installPhase = '' 41 46 mkdir -p $out/bin 42 - cp bin/soapdump $out/bin/ 47 + cp build/soapdump $out/bin/ 48 + 49 + # Generate shell completions 50 + mkdir -p completions 51 + $out/bin/soapdump --help > /dev/null 2>&1 || true 52 + 53 + # Install shell completions if they exist 54 + if [ -f completions/soapdump.bash ]; then 55 + installShellCompletion --bash completions/soapdump.bash 56 + fi 57 + if [ -f completions/soapdump.fish ]; then 58 + installShellCompletion --fish completions/soapdump.fish 59 + fi 60 + if [ -f completions/soapdump.zsh ]; then 61 + installShellCompletion --zsh completions/soapdump.zsh 62 + fi 63 + 64 + # Generate man page 65 + mkdir -p $out/share/man/man1 66 + $out/bin/soapdump --help | sed 's/^/ /' > $out/share/man/man1/soapdump.1 43 67 ''; 68 + 69 + meta = with pkgs.lib; { 70 + description = "A high-performance PayPal SOAP log parser"; 71 + homepage = "https://github.com/taciturnaxolotl/soapdump"; 72 + license = licenses.mit; 73 + maintainers = with maintainers; [ taciturnaxolotl ]; 74 + platforms = platforms.linux ++ platforms.darwin; 75 + }; 44 76 }; 45 - 77 + in 78 + { 46 79 default = soapdump; 47 - }; 48 - 49 - devShells.default = pkgs.mkShell { 50 - inherit buildInputs nativeBuildInputs; 51 - 52 - shellHook = '' 53 - echo "SoapDump development environment loaded" 54 - ''; 55 - }; 56 - 57 - apps = rec { 58 - soapdump = { 80 + } 81 + ); 82 + 83 + apps = forAllSystems ( 84 + { pkgs }: 85 + { 86 + default = { 59 87 type = "app"; 60 - program = "${self.packages.${system}.default}/bin/soapdump"; 61 - drv = self.packages.${system}.default; 88 + program = "${self.packages.${pkgs.system}.default}/bin/soapdump"; 62 89 }; 63 - 64 - default = soapdump; 65 - }; 66 - } 67 - ); 90 + } 91 + ); 92 + 93 + devShells = forAllSystems ( 94 + { pkgs }: 95 + { 96 + default = pkgs.mkShell { 97 + buildInputs = with pkgs; [ 98 + cmake 99 + clang 100 + ]; 101 + 102 + shellHook = '' 103 + echo "SoapDump development environment loaded" 104 + ''; 105 + }; 106 + } 107 + ); 108 + 109 + formatter = forAllSystems ({ pkgs }: pkgs.nixfmt-tree); 110 + }; 68 111 }