summaryrefslogtreecommitdiff
path: root/overlays/smartprom/default.nix
blob: 35e946085d7a098c3948565ffb30f947eafe7ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ prev, sources, ... }:
{
  smartprom =
    with prev.poetry2nix;
    mkPoetryApplication {
      inherit (sources.smartprom) pname version;
      projectDir = cleanPythonSources {
        src = prev.runCommand "sources" {} ''
          mkdir $out
          cp -r ${sources.smartprom.src}/. $out

          mkdir $out/smartprom
          mv $out/megaraid.py $out/smartprom
          mv $out/smartprom.py $out/smartprom/__main__.py
          sed -ri 's/import megaraid/from . import megaraid/' $out/smartprom/__main__.py
          echo >> $out/smartprom/__init__.py

          cp ${./pyproject.toml} $out/pyproject.toml
          cp ${./poetry.lock} $out/poetry.lock
        '';
      };
    };
}