flake: add a pkgs.python
template
This commit is contained in:
parent
c18554dfbd
commit
97d56b0314
19
flake.nix
19
flake.nix
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
28
templates/pkgs/python/default.nix
Normal file
28
templates/pkgs/python/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user