nix-overlay/default.nix

25 lines
No EOL
711 B
Nix

{ mkDerivation, mayo, wrapQtAppsHook, lib }:
let
step2stl =
name: file:
let
pname = "${name}.stl";
extension = lib.last (lib.strings.splitString "." file);
in
lib.throwIfNot
(lib.elem extension ["step" "STEP" "stp"])
''Input file have a "${extension}" extension, but valid STEP-file should have one of the following extentions: "step" "STEP" "stp"''
mkDerivation {
inherit pname;
version = "v0";
src = ./.;
nativeBuildInputs = [ mayo wrapQtAppsHook ];
buildPhase = ''${lib.getExe mayo} ${file} -e ${pname}'';
installPhase = ''
cp ${pname} $out
rm ${pname}
'';
};
rlib = { inherit step2stl; };
in
rlib