Work on blender-cadsketcher, some tweaks to make Traverse's life easier
This commit is contained in:
parent
f7cc91e850
commit
4811ba6d00
@ -4,6 +4,7 @@
|
||||
environment.systemPackages = with pkgs; [
|
||||
pkgs.openscad
|
||||
pkgs.blender
|
||||
#pkgs.blender-cadsketcher
|
||||
#pkgs.py-slvs
|
||||
pkgs.freecad
|
||||
(pkgs.appimageTools.wrapType2
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
networking.hostName = hostname; # Define your hostname.
|
||||
networking.networkmanager.enable = true;
|
||||
nix.trustedUsers = [ "root" "traverseda"];
|
||||
nix.settings.trusted-users = [ "root" "traverseda" "logic11"];
|
||||
|
||||
virtualisation.vmVariant = {
|
||||
# following configuration is added only when building VM with build-vm
|
||||
|
@ -1,57 +1,34 @@
|
||||
{
|
||||
description = "Blender CAD Sketcher";
|
||||
{ lib, blender, python3Packages, fetchFromGitHub, pkgs }:
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
shellHook = ''
|
||||
'';
|
||||
packages = [
|
||||
(
|
||||
let
|
||||
py-slvs = pythonPkgs:
|
||||
pythonPkgs.buildPythonPackage rec {
|
||||
pname = "py-slvs";
|
||||
version = "1.0.6";
|
||||
let
|
||||
py-slvs = python3Packages.buildPythonPackage rec {
|
||||
pname = "py-slvs";
|
||||
version = "1.0.6";
|
||||
|
||||
src = pythonPkgs.fetchPypi {
|
||||
pname = "py_slvs";
|
||||
version = "1.0.6";
|
||||
sha256 = "sha256-U6T/aXy0JTC1ptL5oBmch0ytSPmIkRA8XOi31NpArnI=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "realthunder";
|
||||
repo = "slvs_py";
|
||||
rev = "v${version}";
|
||||
sha256 = "hBuW8Guqli/jMFPygG8jq5ZLs508Ss+lmBORuW6yTxs=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [swig];
|
||||
pyproject = true;
|
||||
nativeBuildInputs = [ pkgs.swig pkgs.cmake pkgs.ninja ];
|
||||
|
||||
propagatedBuildInputs = with pythonPkgs; [
|
||||
cmake
|
||||
ninja
|
||||
setuptools
|
||||
scikit-build
|
||||
];
|
||||
cmakeFlags = [
|
||||
"-B."
|
||||
"-H${src}"
|
||||
];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
propagatedBuildInputs = with python3Packages; [ setuptools wheel scikit-build cmake ninja ];
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Python binding of SOLVESPACE geometry constraint solver";
|
||||
homepage = "https://github.com/realthunder/slvs_py";
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
};
|
||||
|
||||
blenderCadSketcher = pkgs.blender.withPackages (p: [(py-slvs p)]);
|
||||
in
|
||||
blenderCadSketcher
|
||||
)
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
meta = {
|
||||
description = "Python binding of SOLVESPACE geometry constraint solver";
|
||||
homepage = "https://github.com/realthunder/slvs_py";
|
||||
license = lib.licenses.gpl3;
|
||||
};
|
||||
};
|
||||
in
|
||||
blender.overrideAttrs (oldAttrs: {
|
||||
name = "blender-cadsketcher-${oldAttrs.version}";
|
||||
buildInputs = oldAttrs.buildInputs ++ [ py-slvs ];
|
||||
})
|
||||
|
@ -1,11 +1,16 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
# URL and SHA256 for Creality Print AppImage
|
||||
appimageUrl = "https://file2-cdn.creality.com/file/05a4538e0c7222ce547eb8d58ef0251e/Creality_Print-v4.3.7.6627-x86_64-Release.AppImage";
|
||||
appimageSha256 = "sha256-WUsL7UbxSY94H4F1Ww8vLsfRyeg2/DZ+V4B6eH3M6+M=";
|
||||
|
||||
# Wrap the AppImage using appimageTools
|
||||
creality-print = pkgs.appimageTools.wrapType2 {
|
||||
name = "creality-print";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://file2-cdn.creality.com/file/05a4538e0c7222ce547eb8d58ef0251e/Creality_Print-v4.3.7.6627-x86_64-Release.AppImage";
|
||||
sha256 = "sha256-WUsL7UbxSY94H4F1Ww8vLsfRyeg2/DZ+V4B6eH3M6+M=";
|
||||
url = appimageUrl;
|
||||
sha256 = appimageSha256;
|
||||
};
|
||||
profile = ''
|
||||
export LC_ALL=C.UTF-8
|
||||
@ -13,6 +18,7 @@ let
|
||||
multiPkgs = pkgs: with pkgs; [ qt5.qtbase libGL libz ];
|
||||
};
|
||||
|
||||
# Create a desktop entry for Creality Print
|
||||
desktopItem = pkgs.makeDesktopItem {
|
||||
name = "creality-print";
|
||||
exec = "${creality-print}/bin/creality-print";
|
||||
@ -23,24 +29,29 @@ let
|
||||
};
|
||||
|
||||
in
|
||||
# Define the package
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "creality-print-app";
|
||||
buildInputs = [ creality-print ];
|
||||
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
|
||||
# No sources to unpack
|
||||
unpackPhase = "true";
|
||||
|
||||
# Installation phase
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/applications
|
||||
cp ${creality-print}/bin/* $out/bin
|
||||
ln -s ${desktopItem}/share/applications/* $out/share/applications/
|
||||
'';
|
||||
|
||||
# Package metadata
|
||||
meta = with pkgs.lib; {
|
||||
description = "Creality Print is a 3D printer software for Creality printers";
|
||||
homepage = "https://www.creality.com/";
|
||||
license = licenses.unfree;
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -6,5 +6,5 @@
|
||||
{
|
||||
# example = pkgs.callPackage ./example { };
|
||||
creality-print = pkgs.callPackage ./creality-print { };
|
||||
py-slvs = pkgs.callPackage ./py-slvs { };
|
||||
blender-cadsketcher = pkgs.callPackage ./blender-cadsketcher { };
|
||||
}
|
||||
|
@ -1,57 +0,0 @@
|
||||
{
|
||||
description = "Blender CAD Sketcher";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
shellHook = ''
|
||||
'';
|
||||
packages = [
|
||||
(
|
||||
let
|
||||
py-slvs = pythonPkgs:
|
||||
pythonPkgs.buildPythonPackage rec {
|
||||
pname = "py-slvs";
|
||||
version = "1.0.6";
|
||||
|
||||
src = pythonPkgs.fetchPypi {
|
||||
pname = "py_slvs";
|
||||
version = "1.0.6";
|
||||
sha256 = "sha256-U6T/aXy0JTC1ptL5oBmch0ytSPmIkRA8XOi31NpArnI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [swig];
|
||||
pyproject = true;
|
||||
|
||||
propagatedBuildInputs = with pythonPkgs; [
|
||||
cmake
|
||||
ninja
|
||||
setuptools
|
||||
scikit-build
|
||||
];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Python binding of SOLVESPACE geometry constraint solver";
|
||||
homepage = "https://github.com/realthunder/slvs_py";
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
};
|
||||
|
||||
blenderWithPySlvs = pkgs.blender.withPackages (p: [(py-slvs p)]);
|
||||
in
|
||||
blenderWithPySlvs
|
||||
)
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user