From 49e82eff6e36ae2d04c8c1aa0c641a9e3c3bf6d6 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 22 Aug 2025 16:43:12 +0200 Subject: [PATCH] flake.nix: package log parsing script --- .gitignore | 1 + flake.nix | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.nix b/flake.nix index 3849f0f..056575b 100644 --- a/flake.nix +++ b/flake.nix @@ -17,12 +17,25 @@ devShells = forAllSystems (system: pkgs: { default = pkgs.mkShell { packages = with pkgs; [ + ruff (python3.withPackages (ppkgs: with ppkgs; [ - tqdm psycopg2-binary ])) ]; }; }); + + packages = forAllSystems (system: pkgs: { + default = self.packages.${system}.mclog2psql; + mclog2psql = pkgs.writers.writePython3Bin "mclog2psql" { + libraries = [ pkgs.python3Packages.psycopg2 ]; + flakeIgnore = [ "E265" "E501" ]; + } (lib.pipe ./mclog2psql/main.py [ + builtins.readFile + (lib.splitString "\n") + (lib.filter (line: !lib.hasPrefix "#!" line)) + (lib.concatStringsSep "\n") + ]); + }); }; }