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

38
default.nix Normal file
View File

@ -0,0 +1,38 @@
{
packageName,
version,
buildPythonPackage,
# build-system
setuptools_scm,
# dependencies
psutil,
pydantic-uuid-model,
python-magic,
requests,
}:
let
pname = (builtins.replaceStrings ["-"] ["_"] packageName);
in buildPythonPackage rec {
inherit pname version;
pyproject = true;
build-system = [ setuptools_scm ];
src = ./.;
propagatedBuildInputs = [
psutil
pydantic-uuid-model
python-magic
requests
];
pythonImportsCheck = [ pname ];
meta = {
description = "A python data storage backend library";
homepage = "https://git.chaosbit.de/bit/pydatastorage";
};
}

48
flake.lock generated Normal file
View File

@ -0,0 +1,48 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pydantic-uuid-model": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1731232726,
"narHash": "sha256-j2kkXkw6KKfGAu7Qd879pWDNupL7ShyininLCupOGFY=",
"ref": "refs/heads/master",
"rev": "68803636acdba905d64d34d8986d5f99f07b6d7a",
"revCount": 2,
"type": "git",
"url": "https://git.chaosbit.de/bit/pydanticuuidmodel"
},
"original": {
"type": "git",
"url": "https://git.chaosbit.de/bit/pydanticuuidmodel"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"pydantic-uuid-model": "pydantic-uuid-model"
}
}
},
"root": "root",
"version": 7
}

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;
};
};
}