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