flake: add a pkgs.python template

This commit is contained in:
Colin 2024-06-07 07:23:35 +00:00
parent c18554dfbd
commit 97d56b0314
2 changed files with 41 additions and 6 deletions

View File

@ -635,6 +635,19 @@
path = ./templates/env/python-data;
description = "python environment for data processing";
};
pkgs.make = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.make'`
path = ./templates/pkgs/make;
description = "default Makefile-based derivation";
};
pkgs.python = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.python'`
path = ./templates/pkgs/python;
description = "python package";
};
pkgs.rust-inline = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.rust-inline'`
@ -647,12 +660,6 @@
path = ./templates/pkgs/rust;
description = "rust package fit to ship in nixpkgs";
};
pkgs.make = {
# initialize with:
# - `nix flake init -t '/home/colin/dev/nixos/#pkgs.make'`
path = ./templates/pkgs/make;
description = "default Makefile-based derivation";
};
};
};
}

View File

@ -0,0 +1,28 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
}: buildPythonPackage {
pname = "mypackage";
version = "0.1-unstable-2024-06-04";
format = "pyproject"; # or setuptools
src = fetchFromGitHub {
owner = "owner";
repo = "repo";
rev = "${version}";
};
propagatedBuildInputs = [
# other python modules this depends on, if this package is supposed to be importable
];
pythonImportsCheck = [
"mymodule"
];
meta = with lib; {
homepage = "https://example.com";
description = "python template project";
maintainers = with maintainers; [ colinsane ];
};
}