Skip to content

Commit efa4546

Browse files
authored
chore(nix): extract project name and version from pyproject.toml (#13)
* chore: use package name and version from pyproject.toml * chore: use 'with' for convenience
1 parent 589e48a commit efa4546

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

beku.nix

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
{ python3 }:
2-
3-
python3.pkgs.buildPythonApplication {
4-
pname = "beku-stackabletech";
5-
version = "0.0.9";
2+
with python3;
3+
let
4+
manifest = (pkgs.lib.importTOML ./pyproject.toml).project;
5+
in
6+
pkgs.buildPythonApplication {
7+
pname = manifest.name;
8+
version = manifest.version;
69

710
format = "pyproject";
811

912
src = builtins.path {
1013
path = ./.;
11-
name = "beku-stackabletech";
14+
name = manifest.name;
1215
};
1316

14-
nativeBuildInputs = [
15-
python3.pkgs.setuptools
17+
nativeBuildInputs = with pkgs; [
18+
setuptools
1619
];
1720

18-
propagatedBuildInputs = [
19-
python3.pkgs.jinja2
20-
python3.pkgs.pyyaml
21+
propagatedBuildInputs = with pkgs; [
22+
jinja2
23+
pyyaml
2124
];
2225
}
2326

0 commit comments

Comments
 (0)