adds flake

This commit is contained in:
Marvin Preuss 2025-10-07 09:53:36 +02:00
parent 62d4f67f63
commit 433e464187
3 changed files with 133 additions and 0 deletions

3
.gitignore vendored
View file

@ -169,3 +169,6 @@ cython_debug/
# PyPI configuration file
.pypirc
# NIX
/result

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1759733170,
"narHash": "sha256-TXnlsVb5Z8HXZ6mZoeOAIwxmvGHp1g4Dw89eLvIwKVI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8913c168d1c56dc49a7718685968f38752171c3b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

69
flake.nix Normal file
View file

@ -0,0 +1,69 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
inherit (pkgs) python3Packages;
meshcore = python3Packages.buildPythonPackage rec {
pname = "meshcore";
version = "2.1.9";
pyproject = true;
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "sha256-FhTOuVHhpYvmITgxfhXys8AJhRfYnMwCJ3fWJhMf53w=";
};
build-system = [ python3Packages.hatchling ];
dependencies = [
python3Packages.bleak
python3Packages.pycayennelpp
python3Packages.pyserial-asyncio
];
pythonImportsCheck = [ "meshcore" ];
};
pyproject = lib.importTOML ./pyproject.toml;
version = pyproject.project.version;
in
{
packages.meshcore-cli = python3Packages.buildPythonPackage {
pname = "meshcore-cli";
inherit version;
src = ./.;
pyproject = true;
nativeBuildInputs = [
python3Packages.hatchling
python3Packages.setuptools
python3Packages.wheel
];
propagatedBuildInputs = [
meshcore
python3Packages.click
python3Packages.prompt_toolkit
python3Packages.pyserial
python3Packages.requests
];
doCheck = false;
};
}
);
}