48 lines
1.2 KiB
Nix
48 lines
1.2 KiB
Nix
{
|
|
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
|
|
|
outputs = { self, nixpkgs }: let
|
|
inherit (nixpkgs) lib;
|
|
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
"armv7l-linux"
|
|
];
|
|
|
|
forAllSystems = f: lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
|
|
in {
|
|
devShells = forAllSystems (system: pkgs: {
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
ruff
|
|
(python3.withPackages (ppkgs: with ppkgs; [
|
|
psycopg2-binary
|
|
]))
|
|
];
|
|
};
|
|
});
|
|
|
|
overlays.default = final: prev: {
|
|
inherit (self.packages.${final.system}) mclog2psql;
|
|
};
|
|
|
|
nixosModules.default = ./module.nix;
|
|
|
|
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")
|
|
]);
|
|
});
|
|
};
|
|
}
|