This commit is contained in:
bit
2024-11-10 11:03:43 +01:00
parent 419808a837
commit 460f603510
3 changed files with 141 additions and 0 deletions

55
flake.nix Normal file
View File

@@ -0,0 +1,55 @@
{
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;
};
};
}