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
···
nix develop
```
+
### Using CMake
+
+
```bash
+
# Build the project
+
cmake -B build -S .
+
cmake --build build --config Release
+
+
# Run the parser
+
./build/soapdump payments.log
+
```
+
+
### Installation
+
+
Install directly from the flake:
+
+
```bash
+
nix profile install github:taciturnaxolotl/soapdump
+
```
+
+
Or run without installing:
+
+
```bash
+
nix run github:taciturnaxolotl/soapdump -- payments.log
+
```
+
## Output Format
Tab-separated values with the following fields:
···
<p align="center">
<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>
-
</p>
+
</p>
+90 -47
flake.nix
···
{
-
description = "PayPal SOAP Log Parser";
+
description = "SoapDump - A high-performance PayPal SOAP log parser";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
-
utils.url = "github:numtide/flake-utils";
};
-
outputs = { self, nixpkgs, utils }:
-
utils.lib.eachDefaultSystem (system:
-
let
-
pkgs = nixpkgs.legacyPackages.${system};
-
-
# Build dependencies
-
buildInputs = with pkgs; [
-
cmake
-
];
-
-
# Development dependencies
-
nativeBuildInputs = with pkgs; [
-
clang-tools
-
bear
-
];
-
in
-
{
-
packages = rec {
+
outputs = { self, nixpkgs, ... }:
+
let
+
allSystems = [
+
"x86_64-linux" # 64-bit Intel/AMD Linux
+
"aarch64-linux" # 64-bit ARM Linux
+
"x86_64-darwin" # 64-bit Intel macOS
+
"aarch64-darwin" # 64-bit ARM macOS
+
];
+
forAllSystems = f:
+
nixpkgs.lib.genAttrs allSystems (
+
system:
+
f {
+
pkgs = import nixpkgs { inherit system; };
+
}
+
);
+
in
+
{
+
packages = forAllSystems (
+
{ pkgs }:
+
let
+
version = if self ? rev then self.rev else "0.1.0";
soapdump = pkgs.stdenv.mkDerivation {
pname = "soapdump";
-
version = "0.1.0";
+
inherit version;
+
src = self;
-
src = ./.;
-
-
nativeBuildInputs = [ pkgs.clang ];
+
nativeBuildInputs = with pkgs; [
+
cmake
+
clang
+
installShellFiles
+
];
buildPhase = ''
-
mkdir -p bin
-
clang++ -std=c++17 -O3 -o bin/soapdump src/soapdump.cpp
+
cmake -B build -S .
+
cmake --build build --config Release
'';
installPhase = ''
mkdir -p $out/bin
-
cp bin/soapdump $out/bin/
+
cp build/soapdump $out/bin/
+
+
# Generate shell completions
+
mkdir -p completions
+
$out/bin/soapdump --help > /dev/null 2>&1 || true
+
+
# Install shell completions if they exist
+
if [ -f completions/soapdump.bash ]; then
+
installShellCompletion --bash completions/soapdump.bash
+
fi
+
if [ -f completions/soapdump.fish ]; then
+
installShellCompletion --fish completions/soapdump.fish
+
fi
+
if [ -f completions/soapdump.zsh ]; then
+
installShellCompletion --zsh completions/soapdump.zsh
+
fi
+
+
# Generate man page
+
mkdir -p $out/share/man/man1
+
$out/bin/soapdump --help | sed 's/^/ /' > $out/share/man/man1/soapdump.1
'';
+
+
meta = with pkgs.lib; {
+
description = "A high-performance PayPal SOAP log parser";
+
homepage = "https://github.com/taciturnaxolotl/soapdump";
+
license = licenses.mit;
+
maintainers = with maintainers; [ taciturnaxolotl ];
+
platforms = platforms.linux ++ platforms.darwin;
+
};
};
-
+
in
+
{
default = soapdump;
-
};
-
-
devShells.default = pkgs.mkShell {
-
inherit buildInputs nativeBuildInputs;
-
-
shellHook = ''
-
echo "SoapDump development environment loaded"
-
'';
-
};
-
-
apps = rec {
-
soapdump = {
+
}
+
);
+
+
apps = forAllSystems (
+
{ pkgs }:
+
{
+
default = {
type = "app";
-
program = "${self.packages.${system}.default}/bin/soapdump";
-
drv = self.packages.${system}.default;
+
program = "${self.packages.${pkgs.system}.default}/bin/soapdump";
};
-
-
default = soapdump;
-
};
-
}
-
);
+
}
+
);
+
+
devShells = forAllSystems (
+
{ pkgs }:
+
{
+
default = pkgs.mkShell {
+
buildInputs = with pkgs; [
+
cmake
+
clang
+
];
+
+
shellHook = ''
+
echo "SoapDump development environment loaded"
+
'';
+
};
+
}
+
);
+
+
formatter = forAllSystems ({ pkgs }: pkgs.nixfmt-tree);
+
};
}