parses paypal soap logs
1{
2 description = "SoapDump - A high-performance PayPal SOAP log parser";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 };
7
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";
29 soapdump = pkgs.stdenv.mkDerivation {
30 pname = "soapdump";
31 inherit version;
32 src = self;
33
34 nativeBuildInputs = with pkgs; [
35 cmake
36 clang
37 installShellFiles
38 ];
39
40 buildPhase = ''
41 cmake -B build -S .
42 cmake --build build --config Release
43 '';
44
45 installPhase = ''
46 mkdir -p $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
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 };
76 };
77 in
78 {
79 default = soapdump;
80 }
81 );
82
83 apps = forAllSystems (
84 { pkgs }:
85 {
86 default = {
87 type = "app";
88 program = "${self.packages.${pkgs.system}.default}/bin/soapdump";
89 };
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 };
111}