From 9dcc57fffcfb8c59ba1026c28cadd07634043cd0 Mon Sep 17 00:00:00 2001 From: David Crompton Date: Fri, 22 Mar 2024 22:55:35 -0400 Subject: [PATCH] universedesktop: variety of changes --- machines/universedesktop/ccache.nix | 6 + machines/universedesktop/configuration.nix | 15 +- machines/universedesktop/programs/art.nix | 201 +++++++++--------- machines/universedesktop/programs/audio.nix | 4 +- machines/universedesktop/programs/cad.nix | 72 +------ machines/universedesktop/programs/desktop.nix | 1 + 6 files changed, 122 insertions(+), 177 deletions(-) diff --git a/machines/universedesktop/ccache.nix b/machines/universedesktop/ccache.nix index 690f115..f1dc751 100644 --- a/machines/universedesktop/ccache.nix +++ b/machines/universedesktop/ccache.nix @@ -31,8 +31,14 @@ substituters = [ "https://cuda-maintainers.cachix.org" ]; + trusted-substituters = [ + "https://cuda-maintainers.cachix.org" + ]; trusted-public-keys = [ "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" ]; + trusted-users = [ + "universe" + ]; }; } diff --git a/machines/universedesktop/configuration.nix b/machines/universedesktop/configuration.nix index e685fce..26aa202 100644 --- a/machines/universedesktop/configuration.nix +++ b/machines/universedesktop/configuration.nix @@ -170,10 +170,19 @@ nixpkgs.config.allowUnfree = true; services.xserver.videoDrivers = [ "nvidia" ]; + # Wayland support - boot.kernelParams = ["nvidia_drm.modeset=1"]; - hardware.opengl.enable = true; - hardware.opengl.driSupport = true; + hardware = { + opengl.enable = true; + opengl.driSupport = true; + opengl.driSupport32Bit = true; + + nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + open = false; + }; + }; services.fwupd.enable = true; diff --git a/machines/universedesktop/programs/art.nix b/machines/universedesktop/programs/art.nix index 85423fb..0b45148 100644 --- a/machines/universedesktop/programs/art.nix +++ b/machines/universedesktop/programs/art.nix @@ -1,117 +1,114 @@ -{ lib, config, pkgs, ... }: let - py3 = pkgs.python3; - py3Pkgs = py3.pkgs; - # For 3D CNC machining - opencamlib = py3Pkgs.toPythonModule (pkgs.stdenv.mkDerivation rec { - pname = "opencamlib"; - version = "2019.07"; - nativeBuildInputs = (with pkgs;[ - cmake - git - doxygen - boost - texlive.combined.scheme-full - ]); - propagatedNativeBuildInputs = (with pkgs; [ - py3 - py3.pkgs.boost - py3.pkgs.vtk - ]); - postPatch = '' - mkdir -p $out/${py3.sitePackages}/{lib,ocl} - sed -e 's#LIBRARY DESTINATION ''${PYTHON_ARCH_PACKAGES}#LIBRARY DESTINATION '"$out"'/${py3.sitePackages}#g' -i src/pythonlib/pythonlib.cmake - sed -e 's#DESTINATION ''${PYTHON_SITE_PACKAGES}#DESTINATION '"$out"'/${py3.sitePackages}#g' -i src/pythonlib/pythonlib.cmake - ''; - cmakeFlags = [ - "-DVERSION_STRING=2019.07" - "-DBUILD_CXX_LIB=ON" - "-DBUILD_PY_LIB=ON" - "-DUSE_PY_3=ON" - "-DCMAKE_BUILD_TYPE=Release" +{ lib, config, pkgs, ... }: { + nixpkgs.overlays = [(final: prev: rec { + pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ + ( + python-final: python-prev: let + py = python-prev; + in { + opencamlib = py.toPythonModule (pkgs.stdenv.mkDerivation rec { + pname = "opencamlib"; + version = "2019.07"; + nativeBuildInputs = (with pkgs;[ + cmake + git + doxygen + boost + texlive.combined.scheme-full + ]); + propagatedNativeBuildInputs = [ + py.python + py.boost + py.vtk + ]; + postPatch = '' + mkdir -p $out/${py.python.sitePackages}/{lib,ocl} + sed -e 's#LIBRARY DESTINATION ''${PYTHON_ARCH_PACKAGES}#LIBRARY DESTINATION '"$out"'/${py.python.sitePackages}#g' -i src/pythonlib/pythonlib.cmake + sed -e 's#DESTINATION ''${PYTHON_SITE_PACKAGES}#DESTINATION '"$out"'/${py.python.sitePackages}#g' -i src/pythonlib/pythonlib.cmake + ''; + cmakeFlags = [ + "-DVERSION_STRING=2019.07" + "-DBUILD_CXX_LIB=ON" + "-DBUILD_PY_LIB=ON" + "-DUSE_PY_3=ON" + "-DCMAKE_BUILD_TYPE=Release" + ]; + src = pkgs.fetchFromGitHub { + owner = "aewallin"; + repo = "opencamlib"; + rev = "2019.07"; + sha256 = "1a8pxp1mh8x3bfsb0l97vgxrpk482p7q9jprkd4m9hv69vva2bdz"; + }; + }); + equation = py.buildPythonPackage { + pname = "Equation"; + version = "1.2.01"; + nativeBuildInputs = [ + py.setuptools + py.numpy + ]; + src = pkgs.fetchzip { + url = "https://files.pythonhosted.org/packages/2e/cc/115fb1722051f99b9699864586e7f96ca0080645387698af922fade4f7b2/Equation-1.2.01.zip"; + sha256 = "YFxZB3vaC5s49K1AQLFF4WGUr2RpomJTLQdZ24ITXr4="; + }; + }; + morphio = py.toPythonModule ( pkgs.stdenv.mkDerivation rec { + pname = "MorphIO"; + version = "3.3.4"; + nativeBuildInputs = (with pkgs; [ + cmake + ninja + py.numpy + hdf5 + ]); + cmakeFlags = [ + "-DMorphIO_CXX_WARNINGS=OFF" + ]; + postInstall = '' + mkdir -p $out/${py.python.sitePackages} + mv ../morphio $out/${py.python.sitePackages} + cp binds/python/_morphio.* $out/${py.python.sitePackages}/morphio/ + ''; + src = pkgs.fetchFromGitHub { + owner = "BlueBrain"; + repo = "MorphIO"; + rev = "v${version}"; + deepClone = true; + fetchSubmodules = true; + sha256 = "C3zDziG7LF7v22ZvplBrtOYq7iKGnAavfpiBCcShHaQ="; + }; + }); + + } + ) ]; - src = pkgs.fetchFromGitHub { - owner = "aewallin"; - repo = "opencamlib"; - rev = "2019.07"; - sha256 = "1a8pxp1mh8x3bfsb0l97vgxrpk482p7q9jprkd4m9hv69vva2bdz"; - }; - }); - equation = py3Pkgs.buildPythonPackage { - pname = "Equation"; - version = "1.2.01"; - nativeBuildInputs = [ - py3Pkgs.setuptools - py3Pkgs.numpy - ]; - src = pkgs.fetchzip { - url = "https://files.pythonhosted.org/packages/2e/cc/115fb1722051f99b9699864586e7f96ca0080645387698af922fade4f7b2/Equation-1.2.01.zip"; - sha256 = "YFxZB3vaC5s49K1AQLFF4WGUr2RpomJTLQdZ24ITXr4="; - }; - }; - morphio = py3.pkgs.toPythonModule ( pkgs.stdenv.mkDerivation rec { - pname = "MorphIO"; - version = "3.3.4"; - nativeBuildInputs = (with pkgs; [ - cmake - ninja - py3 - py3.pkgs.numpy - hdf5 - ]); - cmakeFlags = [ - "-DMorphIO_CXX_WARNINGS=OFF" - ]; - postInstall = '' - mkdir -p $out/${py3.sitePackages} - mv ../morphio $out/${py3.sitePackages} - cp binds/python/_morphio.* $out/${py3.sitePackages}/morphio/ - ''; - src = pkgs.fetchFromGitHub { - owner = "BlueBrain"; - repo = "MorphIO"; - rev = "v${version}"; - deepClone = true; - fetchSubmodules = true; - sha256 = "C3zDziG7LF7v22ZvplBrtOYq7iKGnAavfpiBCcShHaQ="; - }; - }); -in { - nixpkgs.overlays = [(self: super: rec { # Add CUDA Support to Blender - blender_cuda = super.blender.override { - stdenv = super.ccacheStdenv; + blender_cuda = prev.blender.override { cudaSupport = true; }; - # Add Opencamlib for BlenderCAM Support - blender = blender_cuda.overrideAttrs (old: { - pythonPath = old.pythonPath ++ (with py3Pkgs; [ - # OpenCAMLib support - shapely - equation - opencamlib - # NeuroMorphoVis support - matplotlib - seaborn - pandas - pillow - h5py - morphio - # TODO add BluePy support? - ]); - }); + blender = final.blender_cuda.withPackages (p: with p; [ + # OpenCAMLib support + shapely + equation + opencamlib + # NeuroMorphoVis support + matplotlib + seaborn + pandas + pillow + h5py + morphio + # TODO add BluePy support? + ]); # Update RX and Aseprite - rx = super.rx.overrideAttrs (old: { + rx = prev.rx.overrideAttrs (old: { version = "git"; - src = super.fetchFromGitHub { + src = prev.fetchFromGitHub { owner = "cloudhead"; repo = old.pname; rev = "18625a68921873ebe21a7ea8096409a9f0314541"; sha256 = "sha256-LTpaV/fgYUgA2M6Wz5qLHnTNywh13900g+umhgLvciM="; }; }); - glaxnimate = super.glaxnimate.override { - python3 = self.python310; - }; })]; environment.systemPackages = with pkgs; [ diff --git a/machines/universedesktop/programs/audio.nix b/machines/universedesktop/programs/audio.nix index 3922bf6..153bb84 100644 --- a/machines/universedesktop/programs/audio.nix +++ b/machines/universedesktop/programs/audio.nix @@ -3,7 +3,9 @@ easyeffects helvum - musescore + # https://nixpk.gs/pr-tracker.html?pr=290037 + # Waiting for this ^ + # musescore audacity tidal-hifi diff --git a/machines/universedesktop/programs/cad.nix b/machines/universedesktop/programs/cad.nix index 96af6d8..4ce328d 100644 --- a/machines/universedesktop/programs/cad.nix +++ b/machines/universedesktop/programs/cad.nix @@ -1,74 +1,4 @@ -{ lib, config, pkgs, ... }: let - # FreeCAD uses pyside2 (qt 5.15) which doesn't support > 3.10 - py3 = pkgs.python310; - py3Pkgs = py3.pkgs; - # For 3D CNC machining - opencamlib = py3Pkgs.toPythonModule (pkgs.stdenv.mkDerivation rec { - pname = "opencamlib"; - version = "2019.07"; - nativeBuildInputs = (with pkgs;[ - cmake - git - doxygen - boost - texlive.combined.scheme-full - ]); - propagatedNativeBuildInputs = (with pkgs; [ - py3 - py3.pkgs.boost - py3.pkgs.vtk - ]); - postPatch = '' - mkdir -p $out/${py3.sitePackages}/{lib,ocl} - sed -e 's#LIBRARY DESTINATION ''${PYTHON_ARCH_PACKAGES}#LIBRARY DESTINATION '"$out"'/${py3.sitePackages}#g' -i src/pythonlib/pythonlib.cmake - sed -e 's#DESTINATION ''${PYTHON_SITE_PACKAGES}#DESTINATION '"$out"'/${py3.sitePackages}#g' -i src/pythonlib/pythonlib.cmake - ''; - cmakeFlags = [ - "-DVERSION_STRING=2019.07" - "-DBUILD_CXX_LIB=ON" - "-DBUILD_PY_LIB=ON" - "-DUSE_PY_3=ON" - "-DCMAKE_BUILD_TYPE=Release" - ]; - src = pkgs.fetchFromGitHub { - owner = "aewallin"; - repo = "opencamlib"; - rev = "2019.07"; - sha256 = "1a8pxp1mh8x3bfsb0l97vgxrpk482p7q9jprkd4m9hv69vva2bdz"; - }; - }); - - py3Cad = py3.withPackages (p: (with p; [ - numpy - scipy - seaborn - pandas - matplotlib - ipython - python-lsp-server - opencamlib - ])); -in { - # if you also want support for flakes - nixpkgs.overlays = [(self: super: rec { - freecad = super.freecad.override { - stdenv = super.ccacheStdenv; - python = py3Cad; - boost = py3Pkgs.boost; - inherit (py3Pkgs) - gitpython - matplotlib - pivy - ply - pycollada - pyside2 - pyside2-tools - pyyaml - scipy - shiboken2; - }; - })]; - +{ lib, config, pkgs, ... }: { environment.systemPackages = with pkgs; [ openscad freecad diff --git a/machines/universedesktop/programs/desktop.nix b/machines/universedesktop/programs/desktop.nix index ef52598..232b71a 100644 --- a/machines/universedesktop/programs/desktop.nix +++ b/machines/universedesktop/programs/desktop.nix @@ -26,6 +26,7 @@ discord-canary discord + vesktop betterdiscordctl slack signal-desktop