From aa40cd5fafd26cfaa96137885de160ee3331b570 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Thu, 8 Apr 2021 11:47:55 +0200 Subject: [PATCH 01/16] losurdo: remove caja --- homes/softwares/xmonad.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homes/softwares/xmonad.nix b/homes/softwares/xmonad.nix index 2f3b4fa..2bd8829 100644 --- a/homes/softwares/xmonad.nix +++ b/homes/softwares/xmonad.nix @@ -47,7 +47,6 @@ home.packages = [ pkgs.acpilight pkgs.gmrun pkgs.light - pkgs.mate.caja pkgs.rxvt-unicode pkgs.stalonetray pkgs.wmname @@ -60,6 +59,8 @@ home.packages = [ pkgs.xorg.xset pkgs.xsecurelock pkgs.xss-lock +] ++ lib.optionals config.host.desktop [ + pkgs.mate.caja ]; }; } -- 2.44.1 From f025e3ef800a12e433967cfc5a77696841e21ab6 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Thu, 8 Apr 2021 14:02:40 +0200 Subject: [PATCH 02/16] ssh: custom config on the LAN --- homes/julm.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homes/julm.nix b/homes/julm.nix index e30455b..7e7b1d4 100644 --- a/homes/julm.nix +++ b/homes/julm.nix @@ -38,6 +38,12 @@ home.file.".irssi/passwd".text = '' ''; programs.vim.enable = true; programs.ssh.enable = true; +programs.ssh.matchBlocks."lan.losurdo.sourcephile.fr" = { + compression = true; # Helps to get a better framerate with forwardX11 + forwardX11 = true; + forwardX11Trusted = true; + serverAliveInterval = 15; +}; programs.tmux.enable = true; programs.man.enable = true; manual.manpages.enable = false; -- 2.44.1 From b4b1b958cd8951f6304b71661210084bd97d83e2 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 02:35:56 +0200 Subject: [PATCH 03/16] losurdo: install mpv --- homes/julm.nix | 6 ------ homes/julm/hosts/losurdo.nix | 4 ++++ homes/julm/hosts/oignon.nix | 7 +++++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/homes/julm.nix b/homes/julm.nix index 7e7b1d4..38a134e 100644 --- a/homes/julm.nix +++ b/homes/julm.nix @@ -221,11 +221,5 @@ home.packages = [ pkgs.xclip pkgs.xorg.xkill pkgs.xsane - ] ++ lib.optionals (config.host.name == "oignon") [ - pkgs.blender - pkgs.freecad - pkgs.graphviz - #pkgs.libva-utils - #pkgs.sweethome3d.application ]; } diff --git a/homes/julm/hosts/losurdo.nix b/homes/julm/hosts/losurdo.nix index bfacbce..a887c74 100644 --- a/homes/julm/hosts/losurdo.nix +++ b/homes/julm/hosts/losurdo.nix @@ -4,5 +4,9 @@ config = lib.mkIf (config.host.name == "losurdo") { services.gpg-agent.pinentryFlavor = lib.mkForce "curses"; xsession.enable = true; xsession.windowManager.xmonad.enable = true; +home.packages = [ + pkgs.glxinfo + pkgs.mpv +]; }; } diff --git a/homes/julm/hosts/oignon.nix b/homes/julm/hosts/oignon.nix index 7b71441..393ebe7 100644 --- a/homes/julm/hosts/oignon.nix +++ b/homes/julm/hosts/oignon.nix @@ -27,5 +27,12 @@ home.sessionVariables = { GNUPGHOME = "$HOME/documents/sec/.gnupg"; PASSWORD_STORE_DIR = "$HOME/documents/sec/.password-store"; }; +home.packages = [ + pkgs.blender + pkgs.freecad + pkgs.graphviz + #pkgs.libva-utils + #pkgs.sweethome3d.application +]; }; } -- 2.44.1 From 71640c3765c2ac8a63fe0dcd74b3eb67f4ff5bc2 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 03:05:24 +0200 Subject: [PATCH 04/16] oignon: add x2goclient --- homes/julm/hosts/oignon.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homes/julm/hosts/oignon.nix b/homes/julm/hosts/oignon.nix index 393ebe7..0e90b39 100644 --- a/homes/julm/hosts/oignon.nix +++ b/homes/julm/hosts/oignon.nix @@ -31,6 +31,7 @@ home.packages = [ pkgs.blender pkgs.freecad pkgs.graphviz + pkgs.x2goclient #pkgs.libva-utils #pkgs.sweethome3d.application ]; -- 2.44.1 From 4518b00ee8600e4466e283638e79c8d9d4824f31 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 03:06:07 +0200 Subject: [PATCH 05/16] home-manager: use home.sessionPath --- homes/julm.nix | 2 +- homes/sevy.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homes/julm.nix b/homes/julm.nix index 38a134e..5fa542f 100644 --- a/homes/julm.nix +++ b/homes/julm.nix @@ -70,13 +70,13 @@ services.redshift.enable = lib.mkDefault config.host.desktop; xsession.enable = lib.mkDefault config.host.desktop; xsession.windowManager.xmonad.enable = lib.mkDefault config.host.desktop; home.stateVersion = "20.09"; +home.sessionPath = [ "${config.home.homeDirectory}/bin" ]; home.sessionVariables = { EDITOR = "vim"; LANG = "fr_FR.UTF-8"; LESS = "-FRSX"; LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; MANPAGER = "less"; - PATH = lib.makeBinPath [ config.home.homeDirectory ] + ":$PATH"; }; # Warning: triggers a rebuild of mumble #nixpkgs.config.mumble.speechdSupport = lib.mkDefault config.host.desktop; diff --git a/homes/sevy.nix b/homes/sevy.nix index ff58c1a..5c6435b 100644 --- a/homes/sevy.nix +++ b/homes/sevy.nix @@ -22,13 +22,13 @@ home.file.".profile".text = '' ''; services.gpg-agent.enable = true; services.redshift.enable = config.host.desktop; +home.sessionPath = [ "${config.home.homeDirectory}/bin" ]; home.sessionVariables = { EDITOR = "vim -g"; LANG = "fr_FR.UTF-8"; LESS = "-FRSX"; LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; MANPAGER = "less"; - PATH = lib.makeBinPath [ config.home.homeDirectory ] + ":$PATH"; }; home.packages = [ pkgs.acpi -- 2.44.1 From 4af57bfc69f381141c97e5ef6318fc573ff75991 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 16:42:16 +0200 Subject: [PATCH 06/16] youtube-dl: update to latest --- nixpkgs/overlays.nix | 1 + nixpkgs/overlays/youtube-dl.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 nixpkgs/overlays/youtube-dl.nix diff --git a/nixpkgs/overlays.nix b/nixpkgs/overlays.nix index a0d1205..546f132 100644 --- a/nixpkgs/overlays.nix +++ b/nixpkgs/overlays.nix @@ -4,4 +4,5 @@ map import overlays/podl.nix overlays/zerobin.nix overlays/freecad.nix + overlays/youtube-dl.nix ] diff --git a/nixpkgs/overlays/youtube-dl.nix b/nixpkgs/overlays/youtube-dl.nix new file mode 100644 index 0000000..1ffa92d --- /dev/null +++ b/nixpkgs/overlays/youtube-dl.nix @@ -0,0 +1,9 @@ +self: super: { + youtube-dl = super.youtube-dl.overrideAttrs (oldAttrs: rec { + version = "2021.04.07"; + src = super.fetchurl { + url = "https://yt-dl.org/downloads/${version}/${oldAttrs.pname}-${version}.tar.gz"; + sha256 = "02d51l6gdjr3zhhi7ydf5kzv8dv4jzq0ygja7zb2h9k7hnl0l27m"; + }; + }); +} -- 2.44.1 From c9a68ecb5d481ad2700a981d20f9252e386a6d05 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 16:43:36 +0200 Subject: [PATCH 07/16] mpv: configure youtube-dl --- homes/softwares/mpv.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homes/softwares/mpv.nix b/homes/softwares/mpv.nix index 9f84943..3c3cdf8 100644 --- a/homes/softwares/mpv.nix +++ b/homes/softwares/mpv.nix @@ -4,6 +4,7 @@ home.file = { hwdec=auto-safe profile=gpu-hq vo=gpu + ytdl-format=18/mp4-480p/hls-480p/http-360p/mp4 ''; }; } -- 2.44.1 From c81a75fc549408458ba61029e21648383e5a27aa Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 16:45:03 +0200 Subject: [PATCH 08/16] blender: only working on losurdo --- homes/julm/hosts/losurdo.nix | 2 ++ homes/julm/hosts/oignon.nix | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homes/julm/hosts/losurdo.nix b/homes/julm/hosts/losurdo.nix index a887c74..8d8686d 100644 --- a/homes/julm/hosts/losurdo.nix +++ b/homes/julm/hosts/losurdo.nix @@ -5,8 +5,10 @@ services.gpg-agent.pinentryFlavor = lib.mkForce "curses"; xsession.enable = true; xsession.windowManager.xmonad.enable = true; home.packages = [ + pkgs.blender pkgs.glxinfo pkgs.mpv + pkgs.pavucontrol ]; }; } diff --git a/homes/julm/hosts/oignon.nix b/homes/julm/hosts/oignon.nix index 0e90b39..81c3905 100644 --- a/homes/julm/hosts/oignon.nix +++ b/homes/julm/hosts/oignon.nix @@ -28,10 +28,9 @@ home.sessionVariables = { PASSWORD_STORE_DIR = "$HOME/documents/sec/.password-store"; }; home.packages = [ - pkgs.blender pkgs.freecad pkgs.graphviz - pkgs.x2goclient + #pkgs.x2goclient #pkgs.libva-utils #pkgs.sweethome3d.application ]; -- 2.44.1 From dec666516dbdc7efb9b74863e266ce3f807d5ab1 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 9 Apr 2021 16:48:48 +0200 Subject: [PATCH 09/16] oignon: add QGIS --- homes/julm/hosts/oignon.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homes/julm/hosts/oignon.nix b/homes/julm/hosts/oignon.nix index 81c3905..0657549 100644 --- a/homes/julm/hosts/oignon.nix +++ b/homes/julm/hosts/oignon.nix @@ -30,7 +30,8 @@ home.sessionVariables = { home.packages = [ pkgs.freecad pkgs.graphviz - #pkgs.x2goclient + pkgs.x2goclient + pkgs.qgis #pkgs.libva-utils #pkgs.sweethome3d.application ]; -- 2.44.1 From 5da4c10f6439c921bf3a7e1548875de53892b192 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Mon, 12 Apr 2021 15:18:24 +0200 Subject: [PATCH 10/16] oignon: uninstall x2goclient --- homes/julm/hosts/oignon.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homes/julm/hosts/oignon.nix b/homes/julm/hosts/oignon.nix index 0657549..940b792 100644 --- a/homes/julm/hosts/oignon.nix +++ b/homes/julm/hosts/oignon.nix @@ -30,7 +30,7 @@ home.sessionVariables = { home.packages = [ pkgs.freecad pkgs.graphviz - pkgs.x2goclient + #pkgs.x2goclient pkgs.qgis #pkgs.libva-utils #pkgs.sweethome3d.application -- 2.44.1 From cb36331e150a572e185258f31632d6a6ba499faf Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sat, 10 Apr 2021 07:41:14 +0200 Subject: [PATCH 11/16] blender: update to 2.92 --- nixpkgs/overlays.nix | 1 + nixpkgs/overlays/blender.nix | 5 + nixpkgs/pkgs/blender/darwin.patch | 59 +++++++++ nixpkgs/pkgs/blender/default.nix | 172 +++++++++++++++++++++++++ nixpkgs/pkgs/blender/fix-include.patch | 12 ++ 5 files changed, 249 insertions(+) create mode 100644 nixpkgs/overlays/blender.nix create mode 100644 nixpkgs/pkgs/blender/darwin.patch create mode 100644 nixpkgs/pkgs/blender/default.nix create mode 100644 nixpkgs/pkgs/blender/fix-include.patch diff --git a/nixpkgs/overlays.nix b/nixpkgs/overlays.nix index 546f132..2abb945 100644 --- a/nixpkgs/overlays.nix +++ b/nixpkgs/overlays.nix @@ -4,5 +4,6 @@ map import overlays/podl.nix overlays/zerobin.nix overlays/freecad.nix + overlays/blender.nix overlays/youtube-dl.nix ] diff --git a/nixpkgs/overlays/blender.nix b/nixpkgs/overlays/blender.nix new file mode 100644 index 0000000..425f3db --- /dev/null +++ b/nixpkgs/overlays/blender.nix @@ -0,0 +1,5 @@ +self: super: { + blender = self.callPackage ../pkgs/blender { + inherit (self.darwin.apple_sdk.frameworks) Cocoa CoreGraphics ForceFeedback OpenAL OpenGL; + }; +} diff --git a/nixpkgs/pkgs/blender/darwin.patch b/nixpkgs/pkgs/blender/darwin.patch new file mode 100644 index 0000000..bfbfb5e --- /dev/null +++ b/nixpkgs/pkgs/blender/darwin.patch @@ -0,0 +1,59 @@ +diff a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake +--- a/build_files/cmake/platform/platform_apple.cmake ++++ b/build_files/cmake/platform/platform_apple.cmake +@@ -80,7 +80,6 @@ else() + message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") + endif() + if(NOT EXISTS "${LIBDIR}/") +- message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'") + endif() + + # ------------------------------------------------------------------------- +@@ -112,10 +111,6 @@ if(WITH_CODEC_SNDFILE) + find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib) + find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib) + list(APPEND LIBSNDFILE_LIBRARIES +- ${_sndfile_FLAC_LIBRARY} +- ${_sndfile_OGG_LIBRARY} +- ${_sndfile_VORBIS_LIBRARY} +- ${_sndfile_VORBISENC_LIBRARY} + ) + + print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}") +@@ -132,7 +127,7 @@ if(WITH_PYTHON) + # normally cached but not since we include them with blender + set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m") + set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m") +- set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a) ++ set(PYTHON_LIBRARY "${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.dylib") + set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}") + # set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled + else() +@@ -173,9 +168,7 @@ endif() + if(WITH_CODEC_FFMPEG) + set(FFMPEG_FIND_COMPONENTS + avcodec avdevice avformat avutil +- mp3lame ogg opus swresample swscale +- theora theoradec theoraenc vorbis vorbisenc +- vorbisfile vpx x264 xvidcore) ++ swresample swscale) + find_package(FFmpeg) + endif() + +@@ -266,7 +259,6 @@ if(WITH_BOOST) + endif() + + if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG) +- set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it ! + endif() + + if(WITH_OPENIMAGEIO) +@@ -439,7 +431,7 @@ else() + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic") + endif() + +-if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5) ++if(FALSE) + # Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024") + endif() diff --git a/nixpkgs/pkgs/blender/default.nix b/nixpkgs/pkgs/blender/default.nix new file mode 100644 index 0000000..9d6d78c --- /dev/null +++ b/nixpkgs/pkgs/blender/default.nix @@ -0,0 +1,172 @@ +{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew +, ilmbase, libXi, libX11, libXext, libXrender +, libjpeg, libpng, libsamplerate, libsndfile +, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python3Packages +, openvdb, libXxf86vm, tbb, alembic +, zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath +, jackaudioSupport ? false, libjack2 +, cudaSupport ? config.cudaSupport or false, cudatoolkit +, colladaSupport ? true, opencollada +, spaceNavSupport ? false, libspnav +, makeWrapper +, pugixml, llvmPackages, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL +, potrace +, openxr-loader +, embree, gmp +}: + +with lib; +let + python = python3Packages.python; + optix = fetchzip { + url = "https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip"; + sha256 = "1b3ccd3197anya2bj3psxdrvrpfgiwva5zfv2xmyrl73nb2dvfr7"; + }; + +in +stdenv.mkDerivation rec { + pname = "blender"; + version = "2.92.0"; + + src = fetchurl { + url = "https://download.blender.org/source/${pname}-${version}.tar.xz"; + sha256 = "15a5vffn18a920286x0avbc2rap56k6y531wgibq68r90g2cz4g7"; + }; + + patches = lib.optional stdenv.isDarwin ./darwin.patch; + + nativeBuildInputs = [ cmake makeWrapper ] ++ optional cudaSupport addOpenGLRunpath; + buildInputs = + [ boost ffmpeg gettext glew ilmbase + freetype libjpeg libpng libsamplerate libsndfile libtiff + opencolorio openexr openimagedenoise openimageio2 openjpeg python zlib fftw jemalloc + alembic + (opensubdiv.override { inherit cudaSupport; }) + tbb + embree + gmp + pugixml + potrace + ] + ++ (if (!stdenv.isDarwin) then [ + libXi libX11 libXext libXrender + libGLU libGL openal + libXxf86vm + openxr-loader + # OpenVDB currently doesn't build on darwin + openvdb + ] + else [ + llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL + ]) + ++ optional jackaudioSupport libjack2 + ++ optional cudaSupport cudatoolkit + ++ optional colladaSupport opencollada + ++ optional spaceNavSupport libspnav; + + postPatch = '' + # allow usage of dynamically linked embree + rm build_files/cmake/Modules/FindEmbree.cmake + '' + + (if stdenv.isDarwin then '' + : > build_files/cmake/platform/platform_apple_xcode.cmake + substituteInPlace source/creator/CMakeLists.txt \ + --replace '${"$"}{LIBDIR}/python' \ + '${python}' \ + --replace '${"$"}{LIBDIR}/openmp' \ + '${llvmPackages.openmp}' + substituteInPlace build_files/cmake/platform/platform_apple.cmake \ + --replace 'set(PYTHON_VERSION 3.7)' \ + 'set(PYTHON_VERSION ${python.pythonVersion})' \ + --replace '${"$"}{PYTHON_VERSION}m' \ + '${"$"}{PYTHON_VERSION}' \ + --replace '${"$"}{LIBDIR}/python' \ + '${python}' \ + --replace '${"$"}{LIBDIR}/opencollada' \ + '${opencollada}' \ + --replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \ + '${python3Packages.numpy}/${python.sitePackages}/numpy' \ + --replace '${"$"}{PYTHON_LIBPATH}/site-packages/requests' \ + '${python3Packages.requests}/${python.sitePackages}/requests' + '' else '' + substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"' + ''); + + cmakeFlags = + [ + "-DWITH_ALEMBIC=ON" + "-DWITH_MOD_OCEANSIM=ON" + "-DWITH_CODEC_FFMPEG=ON" + "-DWITH_CODEC_SNDFILE=ON" + "-DWITH_INSTALL_PORTABLE=OFF" + "-DWITH_FFTW3=ON" + "-DWITH_SDL=OFF" + "-DWITH_OPENCOLORIO=ON" + "-DWITH_OPENSUBDIV=ON" + "-DPYTHON_LIBRARY=${python.libPrefix}" + "-DPYTHON_LIBPATH=${python}/lib" + "-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}" + "-DPYTHON_VERSION=${python.pythonVersion}" + "-DWITH_PYTHON_INSTALL=OFF" + "-DWITH_PYTHON_INSTALL_NUMPY=OFF" + "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" + "-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python.sitePackages}" + "-DPYTHON_REQUESTS_PATH=${python3Packages.numpy}/${python.sitePackages}" + "-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy}/${python.sitePackages}/numpy/core/include" + "-DPYTHON_REQUESTS_INCLUDE_DIRS=${python3Packages.requests}/${python.sitePackages}/requests/core/include" + "-DWITH_OPENVDB=ON" + "-DWITH_TBB=ON" + "-DWITH_IMAGE_OPENJPEG=ON" + "-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}" + ] + ++ optionals stdenv.isDarwin [ + "-DWITH_CYCLES_OSL=OFF" # requires LLVM + "-DWITH_OPENVDB=OFF" # OpenVDB currently doesn't build on darwin + + "-DLIBDIR=/does-not-exist" + ] + # Clang doesn't support "-export-dynamic" + ++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" + ++ optional jackaudioSupport "-DWITH_JACK=ON" + ++ optional cudaSupport [ + "-DWITH_CYCLES_CUDA_BINARIES=ON" + "-DWITH_CYCLES_DEVICE_OPTIX=ON" + "-DOPTIX_ROOT_DIR=${optix}" + ]; + + NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}"; + + # Since some dependencies are built with gcc 6, we need gcc 6's + # libstdc++ in our RPATH. Sigh. + NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib"; + + blenderExecutable = + placeholder "out" + (if stdenv.isDarwin then "/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); + # --python-expr is used to workaround https://developer.blender.org/T74304 + postInstall = '' + wrapProgram $blenderExecutable \ + --prefix PYTHONPATH : ${python3Packages.numpy}/${python.sitePackages} \ + --prefix PYTHONPATH : ${python3Packages.requests}/${python.sitePackages} \ + --add-flags '--python-use-system-env' + ''; + + # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be + # found. See the explanation in libglvnd. + postFixup = optionalString cudaSupport '' + for program in $out/bin/blender $out/bin/.blender-wrapped; do + isELF "$program" || continue + addOpenGLRunpath "$program" + done + ''; + + meta = with lib; { + description = "3D Creation/Animation/Publishing System"; + homepage = "https://www.blender.org"; + # They comment two licenses: GPLv2 and Blender License, but they + # say: "We've decided to cancel the BL offering for an indefinite period." + # OptiX, enabled with cudaSupport, is non-free. + license = with licenses; [ gpl2Plus ] ++ optional cudaSupport unfree; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + maintainers = with maintainers; [ goibhniu veprbl ]; + }; +} diff --git a/nixpkgs/pkgs/blender/fix-include.patch b/nixpkgs/pkgs/blender/fix-include.patch new file mode 100644 index 0000000..44e2147 --- /dev/null +++ b/nixpkgs/pkgs/blender/fix-include.patch @@ -0,0 +1,12 @@ +diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h +index fce901b..1f73c5e 100644 +--- a/intern/smoke/intern/WAVELET_NOISE.h ++++ b/intern/smoke/intern/WAVELET_NOISE.h +@@ -43,6 +43,7 @@ + #ifndef WAVELET_NOISE_H + #define WAVELET_NOISE_H + ++#include + #include + + #ifdef WIN32 -- 2.44.1 From 36ee21d156469ac88a8c4f494c8e3f1abdca5857 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sat, 10 Apr 2021 16:32:57 +0200 Subject: [PATCH 12/16] blender: add python3Packages.requests --- nixpkgs/pkgs/blender/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nixpkgs/pkgs/blender/default.nix b/nixpkgs/pkgs/blender/default.nix index 9d6d78c..f0c07db 100644 --- a/nixpkgs/pkgs/blender/default.nix +++ b/nixpkgs/pkgs/blender/default.nix @@ -7,7 +7,7 @@ , jackaudioSupport ? false, libjack2 , cudaSupport ? config.cudaSupport or false, cudatoolkit , colladaSupport ? true, opencollada -, spaceNavSupport ? false, libspnav +, spaceNavSupport ? stdenv.isLinux, libspnav , makeWrapper , pugixml, llvmPackages, SDL, Cocoa, CoreGraphics, ForceFeedback, OpenAL, OpenGL , potrace @@ -35,7 +35,9 @@ stdenv.mkDerivation rec { patches = lib.optional stdenv.isDarwin ./darwin.patch; - nativeBuildInputs = [ cmake makeWrapper ] ++ optional cudaSupport addOpenGLRunpath; + nativeBuildInputs = + [ cmake makeWrapper python3Packages.wrapPython ] + ++ optional cudaSupport addOpenGLRunpath; buildInputs = [ boost ffmpeg gettext glew ilmbase freetype libjpeg libpng libsamplerate libsndfile libtiff @@ -63,6 +65,7 @@ stdenv.mkDerivation rec { ++ optional cudaSupport cudatoolkit ++ optional colladaSupport opencollada ++ optional spaceNavSupport libspnav; + propagatedBuildInputs = with python3Packages; [ numpy requests ]; postPatch = '' # allow usage of dynamically linked embree @@ -109,11 +112,9 @@ stdenv.mkDerivation rec { "-DPYTHON_VERSION=${python.pythonVersion}" "-DWITH_PYTHON_INSTALL=OFF" "-DWITH_PYTHON_INSTALL_NUMPY=OFF" - "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" - "-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python.sitePackages}" - "-DPYTHON_REQUESTS_PATH=${python3Packages.numpy}/${python.sitePackages}" "-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy}/${python.sitePackages}/numpy/core/include" - "-DPYTHON_REQUESTS_INCLUDE_DIRS=${python3Packages.requests}/${python.sitePackages}/requests/core/include" + "-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python.sitePackages}" + "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" "-DWITH_OPENVDB=ON" "-DWITH_TBB=ON" "-DWITH_IMAGE_OPENJPEG=ON" @@ -142,11 +143,11 @@ stdenv.mkDerivation rec { blenderExecutable = placeholder "out" + (if stdenv.isDarwin then "/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); - # --python-expr is used to workaround https://developer.blender.org/T74304 postInstall = '' + buildPythonPath "$propagatedBuildInputs" wrapProgram $blenderExecutable \ - --prefix PYTHONPATH : ${python3Packages.numpy}/${python.sitePackages} \ - --prefix PYTHONPATH : ${python3Packages.requests}/${python.sitePackages} \ + --prefix PATH : $program_PATH \ + --prefix PYTHONPATH : "$program_PYTHONPATH" \ --add-flags '--python-use-system-env' ''; -- 2.44.1 From 02123265ffcadc8d324693dd63e2276ba1dcefb4 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 16 Apr 2021 18:48:51 +0200 Subject: [PATCH 13/16] blender: use the 2.93 alpha release for LineArt --- nixpkgs/pkgs/blender/default.nix | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/nixpkgs/pkgs/blender/default.nix b/nixpkgs/pkgs/blender/default.nix index f0c07db..b9b8e94 100644 --- a/nixpkgs/pkgs/blender/default.nix +++ b/nixpkgs/pkgs/blender/default.nix @@ -1,7 +1,7 @@ -{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew +{ config, stdenv, lib, fetchgit, fetchzip, boost, cmake, ffmpeg, gettext, glew , ilmbase, libXi, libX11, libXext, libXrender , libjpeg, libpng, libsamplerate, libsndfile -, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python3Packages +, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python39Packages , openvdb, libXxf86vm, tbb, alembic , zlib, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath , jackaudioSupport ? false, libjack2 @@ -17,7 +17,7 @@ with lib; let - python = python3Packages.python; + python = python39Packages.python; optix = fetchzip { url = "https://developer.download.nvidia.com/redist/optix/v7.0/OptiX-7.0.0-include.zip"; sha256 = "1b3ccd3197anya2bj3psxdrvrpfgiwva5zfv2xmyrl73nb2dvfr7"; @@ -26,17 +26,18 @@ let in stdenv.mkDerivation rec { pname = "blender"; - version = "2.92.0"; + version = "2.93.0"; - src = fetchurl { - url = "https://download.blender.org/source/${pname}-${version}.tar.xz"; - sha256 = "15a5vffn18a920286x0avbc2rap56k6y531wgibq68r90g2cz4g7"; + src = fetchgit { + url = "https://git.blender.org/blender.git"; + rev = "ec241eb0d020e20924651490a5b74473e347091d"; + sha256 = "sha256-cQCEn0HggtAspnIy73S9R15HLSrh5wpPrNubEdivLXw="; }; patches = lib.optional stdenv.isDarwin ./darwin.patch; nativeBuildInputs = - [ cmake makeWrapper python3Packages.wrapPython ] + [ cmake makeWrapper python39Packages.wrapPython ] ++ optional cudaSupport addOpenGLRunpath; buildInputs = [ boost ffmpeg gettext glew ilmbase @@ -65,7 +66,7 @@ stdenv.mkDerivation rec { ++ optional cudaSupport cudatoolkit ++ optional colladaSupport opencollada ++ optional spaceNavSupport libspnav; - propagatedBuildInputs = with python3Packages; [ numpy requests ]; + propagatedBuildInputs = with python39Packages; [ numpy requests ]; postPatch = '' # allow usage of dynamically linked embree @@ -88,9 +89,9 @@ stdenv.mkDerivation rec { --replace '${"$"}{LIBDIR}/opencollada' \ '${opencollada}' \ --replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \ - '${python3Packages.numpy}/${python.sitePackages}/numpy' \ + '${python39Packages.numpy}/${python.sitePackages}/numpy' \ --replace '${"$"}{PYTHON_LIBPATH}/site-packages/requests' \ - '${python3Packages.requests}/${python.sitePackages}/requests' + '${python39Packages.requests}/${python.sitePackages}/requests' '' else '' substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"' ''); @@ -112,8 +113,8 @@ stdenv.mkDerivation rec { "-DPYTHON_VERSION=${python.pythonVersion}" "-DWITH_PYTHON_INSTALL=OFF" "-DWITH_PYTHON_INSTALL_NUMPY=OFF" - "-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy}/${python.sitePackages}/numpy/core/include" - "-DPYTHON_NUMPY_PATH=${python3Packages.numpy}/${python.sitePackages}" + "-DPYTHON_NUMPY_INCLUDE_DIRS=${python39Packages.numpy}/${python.sitePackages}/numpy/core/include" + "-DPYTHON_NUMPY_PATH=${python39Packages.numpy}/${python.sitePackages}" "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" "-DWITH_OPENVDB=ON" "-DWITH_TBB=ON" -- 2.44.1 From 8617aabf0e9d1bf2f279a28f39fc7fb772799677 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 16 Apr 2021 18:49:40 +0200 Subject: [PATCH 14/16] losurdo: screen-locker at 10 minutes --- homes/julm/hosts/losurdo.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/homes/julm/hosts/losurdo.nix b/homes/julm/hosts/losurdo.nix index 8d8686d..49818c8 100644 --- a/homes/julm/hosts/losurdo.nix +++ b/homes/julm/hosts/losurdo.nix @@ -10,5 +10,6 @@ home.packages = [ pkgs.mpv pkgs.pavucontrol ]; +services.screen-locker.inactiveInterval = 10; # minutes }; } -- 2.44.1 From 1b4e9d21ab3283ef26e47a2c27ca4eabc204f27c Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Fri, 16 Apr 2021 18:49:54 +0200 Subject: [PATCH 15/16] nix: update flakes and patches --- flake.lock | 12 ++++++------ nixpkgs/patches.nix | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 11f89db..3ce2fa2 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1597053966, - "narHash": "sha256-f9lbPS/GJ1His8fsDqM6gfa8kSqREU4eKiMCS5hrKg4=", + "lastModified": 1617631617, + "narHash": "sha256-PARRCz55qN3gy07VJZIlFeOX420d0nGF0RzGI/9hVlw=", "owner": "numtide", "repo": "flake-utils", - "rev": "ec20f52e2ff61e9c36c2b894b62fc1b4bd04c71b", + "rev": "b2c27d1a81b0dc266270fa8aeecebbd1807fc610", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1617625888, - "narHash": "sha256-GuVivqQPZUskBhu4uQAgWhGI1sVuqz7nRMV+Rc+yWBU=", + "lastModified": 1617824794, + "narHash": "sha256-UGkvzx0nIXHhNq/KwJLjXvKAQRE2V33MuX+UirvqrkQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "f019c1cf16d0019d332ef43cffa0bd9bf007252b", + "rev": "2aa20ae969f2597c4df10a094440a66e9d7f8c86", "type": "github" }, "original": { diff --git a/nixpkgs/patches.nix b/nixpkgs/patches.nix index de7a860..fd84cd0 100644 --- a/nixpkgs/patches.nix +++ b/nixpkgs/patches.nix @@ -5,4 +5,10 @@ url = "https://github.com/NixOS/nixpkgs/pull/83904.diff"; sha256 = "sha256-8W0OHJVJULXXd/dxsg/k7sYQsjdTr9zRp6M5PZ1441k="; }*/ +/* +{ + meta.description = "blender: install with python3Packages.requests, fixes #97250"; + url = "https://github.com/NixOS/nixpkgs/pull/118987.diff"; + sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; +}*/ ] -- 2.44.1 From 99b76d184464ad6a31e0cf2074e93bab03f0be83 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 13 Apr 2021 22:35:05 +0200 Subject: [PATCH 16/16] git-crypt: private/world/julm/hashedPassword --- private/world/julm/hashedPassword | Bin 56 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 private/world/julm/hashedPassword diff --git a/private/world/julm/hashedPassword b/private/world/julm/hashedPassword deleted file mode 100644 index 3268dcac11acbc6492c671278140641171f8d45c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 zcmZQ@_Y83kiVO&0nCf