summaryrefslogtreecommitdiff
path: root/overlays/smartprom/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/smartprom/default.nix')
-rw-r--r--overlays/smartprom/default.nix43
1 files changed, 24 insertions, 19 deletions
diff --git a/overlays/smartprom/default.nix b/overlays/smartprom/default.nix
index 35e94608..eaeb080d 100644
--- a/overlays/smartprom/default.nix
+++ b/overlays/smartprom/default.nix
@@ -1,23 +1,28 @@
1{ prev, sources, ... }: 1{ prev, final, sources, flakeInputs, ... }:
2{ 2{
3 smartprom = 3 smartprom = let
4 with prev.poetry2nix; 4 project = flakeInputs.pyproject-nix.lib.project.loadRequirementsTxt {
5 mkPoetryApplication { 5 projectRoot = sources.smartprom.src;
6 inherit (sources.smartprom) pname version; 6 };
7 projectDir = cleanPythonSources { 7 python = final.python3;
8 src = prev.runCommand "sources" {} '' 8 in python.pkgs.buildPythonApplication {
9 mkdir $out 9 pname = "smartprom";
10 cp -r ${sources.smartprom.src}/. $out 10 version = "2.3.0";
11 11
12 mkdir $out/smartprom 12 src = prev.runCommand "sources" {} ''
13 mv $out/megaraid.py $out/smartprom 13 mkdir $out
14 mv $out/smartprom.py $out/smartprom/__main__.py 14 cp -r ${sources.smartprom.src}/. $out
15 sed -ri 's/import megaraid/from . import megaraid/' $out/smartprom/__main__.py
16 echo >> $out/smartprom/__init__.py
17 15
18 cp ${./pyproject.toml} $out/pyproject.toml 16 mkdir $out/smartprom
19 cp ${./poetry.lock} $out/poetry.lock 17 mv $out/megaraid.py $out/smartprom
20 ''; 18 mv $out/smartprom.py $out/smartprom/__main__.py
21 }; 19 sed -ri 's/import megaraid/from . import megaraid/' $out/smartprom/__main__.py
22 }; 20 echo >> $out/smartprom/__init__.py
21
22 cp ${./pyproject.toml} $out/pyproject.toml
23 '';
24
25 pyproject = true;
26 propagatedBuildInputs = (project.renderers.withPackages { inherit python; }) python.pkgs;
27 };
23} 28}