PyDataStorage/flake.nix
2024-11-10 11:07:56 +01:00

56 lines
1.5 KiB
Nix

{
description = "A python data storage backend library";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
pydantic-uuid-model = {
url = "git+https://git.chaosbit.de/bit/pydanticuuidmodel";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, pydantic-uuid-model }: let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
packageName = "pydatastorage";
version = "0.1.0";
in {
packages."${system}" = {
"${packageName}" = pkgs.python3Packages.callPackage ./default.nix {
inherit packageName version;
inherit (pydantic-uuid-model.packages."${system}") pydantic-uuid-model;
};
default = self.packages."${system}"."${packageName}";
overlay = (final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(final: prev: {
"${packageName}" = self.packages."${system}".default;
})
];
});
inherit (pydantic-uuid-model.packages."${system}") dependencies;
};
devShell."${system}" = let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.packages."${system}".overlay ];
};
customPython = with pkgs; (pkgs.python3.withPackages (ps: [
ps."${packageName}"
]));
packages = [ customPython ] ++ self.packages."${system}".dependencies;
in pkgs.mkShell {
inherit packages;
};
};
}